Need to select second radio button if the first radio button is not clickable

Good Morning,

I have tried several suggestions for if / else statements but I am unable to write the statements correctly to get the desired results.

I have a pop-up window with a selection of radio buttons
image

I need to check if the first radio button is clickable, if it is clickable then click it. If it is not clickable, then select the second radio button.

I have tried:

if (WebUI.verifyElementClickable(findTestObject(‘Object Repository/folder1/folder2/First_Radio’))) {
WebUI.click(findTestObject(‘Object Repository/folder1/folder2/First_Radio’))
}
else
if (WebUI.verifyElementNotClickable(‘Object Repository/folder1/folder2/First_Radio’))
{WebUI.click(findTestObject(‘Object Repository/folder1/folder2/Second_Radio’))}

I have also tried

if (WebUI.verifyElementNotChecked(findTestObject(‘Object Repository/7_workspace/actions/enrich_First_Radio’), 0))
{
WebUI.click(findTestObject(‘Object Repository/7_workspace/actions/enrich_First_Radio’))
}
else
{WebUI.click(findTestObject(‘Object Repository/7_workspace/actions/enrich_Second_Radio’))}

From screenshot above this is the 1st radio button which is not clickable

This is the second radio button

Any suggestion is appreciated.
Thanks

I found my answer.

if (WebUI.verifyElementClickable(findTestObject(‘Object Repository/folder1/folder2/enrich_First_Radio’), FailureHandling.OPTIONAL)) {
WebUI.click(findTestObject(‘Object Repository/folder1/folder2/enrich_First_Radio’))
} else {
WebUI.click(findTestObject(‘Object Repository/folder1/folder2/enrich_Second_Radio’))
}