import org.openqa.selenium.WebDriver
import org.openqa.selenium.By
import org.openqa.selenium.WebElement
import com.kms.katalon.core.webui.driver.DriverFactory
WebDriver driver = DriverFactory.getWebDriver()
List<WebElement> myList= driver.findElements(By.xpath('//div[contains(@class,"swatch-element size-element")]//input[@type="radio" and not(@disabled)]'))
int element_count = myList.size();
println ("Found count of " + element_count.toString());
(Edit: I amended the path to add your input radio buttons not being disabled to get the correct number of enabled buttons.) element_count then can be used in your Random generation:
Finally, you might find the myElementCnt element you could make your xpath into an array, as below, or with the myList list of elements that you got your count from above:
(//div[contains(@class,"swatch-element size-element")]//input[@type="radio" and not(@disabled)])[myElmentCnt]