Is there any way to check if the radio button or check box is selected or not in Katalon

Hi,

I would like to know if there is any way to check if the selected radio button or checkbox is actually selected. I know in Selenium isSelected() method can be used to verify the status. I have created the below keyword using Selenium. Just would like to know the equivalent katalon Code where I can use TestObject

public class Radio_CheckboxHelper {

WebDriver driver = DriverFactory.getWebDriver()	

@Keyword

public void verifyRadioButton_CheckboxSelected(String xpath)
{
	WebElement element = driver.findElement(By.xpath(xpath))
	boolean status = element.isSelected()
	WebUI.verifyEqual(status, true)
	
}

}

Thanks @Russ_Thomas. I have used it before, but it was not working for me that time. Does it work with all the HTML tags or only with input tag. Like .checked attribute in javascript only works with input tag.

There’s a lot to unravel in your question which would lead us “off topic” from your original topic. Indeed, this is not helped by the way that Katalon chose to name some of their APIs (led, most likely by Selenium choices before them). If you want this question answered more “in depth”, ask it again as a new topic (though I suspect you may not like my answer). :confused:

But as to this:

Why? What happened? Was it a genuine HTML input element of type checkbox or radio?

Hi @Russ_Thomas below is the screenshot of HTML code for my radio button element. Should it work for this element?

Sorry, but that’s a button element, not a genuine <input type="radio" ...> element. That’s why WebUI will not succeed.

Thank you so much @Russ_Thomas. I also thought the same.

Hello dear @Russ_Thomas I need your helping about the checkbox button.
I have two radio buttons, OUI and NON (sorry it’s french application).
When i click on NON (the second option) the click not working.

could you please help me to solve this, i’m faced to that two days ago.

thank you very much !!!