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

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’))) {‘Object Repository/folder1/folder2/First_Radio’))
if (WebUI.verifyElementNotClickable(‘Object Repository/folder1/folder2/First_Radio’))
{‘Object Repository/folder1/folder2/Second_Radio’))}

I have also tried

if (WebUI.verifyElementNotChecked(findTestObject(‘Object Repository/7_workspace/actions/enrich_First_Radio’), 0))
{‘Object Repository/7_workspace/actions/enrich_First_Radio’))
{‘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.

I found my answer.

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