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

**URL:** <https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [August 19, 2019, 9:45pm UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782 "2019-08-19T21:45:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhawna\_Rani](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/bhawna_rani/32/16104_2.png) [@Bhawna\_Rani](https://forum.katalon.com/u/Bhawna_Rani)\
**Post date:** [August 19, 2019, 9:45pm UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/1 "2019-08-19T21:45:33Z")

</div>

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)
	
}

```

}

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [August 19, 2019, 10:18pm UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/2 "2019-08-19T22:18:08Z")

</div>

> **[\[WebUI\] Verify Element Checked](https://docs.katalon.com/katalon-studio/docs/webui-verify-element-checked.html)**
>
> Description Verify if the given web element is checked. Parameters Param Param Type Mandatory Description to TestObject Required Represent a web element. timeout int Required System will wait at most...

---

<div class="post-metadata">

**Author:** ![Bhawna\_Rani](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/bhawna_rani/32/16104_2.png) [@Bhawna\_Rani](https://forum.katalon.com/u/Bhawna_Rani)\
**Post date:** [August 20, 2019, 12:17am UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/3 "2019-08-20T00:17:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [August 20, 2019, 2:38am UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/4 "2019-08-20T02:38:55Z")

</div>

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). 😕

But as to this:

> [@Bhawna\_Rani](#):
>
> I have used it before, but it was not working for me that time.

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

---

<div class="post-metadata">

**Author:** ![Bhawna\_Rani](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/bhawna_rani/32/16104_2.png) [@Bhawna\_Rani](https://forum.katalon.com/u/Bhawna_Rani)\
**Post date:** [August 20, 2019, 5:26pm UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/5 "2019-08-20T17:26:29Z")

</div>

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

 ![HTML%20code%20snippet%20for%20radio%20button](https://europe1.discourse-cdn.com/katalon/original/2X/2/2aebc102508f2b1333f43ce10482a2402b8d0c5e.png)

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [August 20, 2019, 6:30pm UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/6 "2019-08-20T18:30:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Bhawna\_Rani](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/bhawna_rani/32/16104_2.png) [@Bhawna\_Rani](https://forum.katalon.com/u/Bhawna_Rani)\
**Post date:** [August 20, 2019, 8:26pm UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/7 "2019-08-20T20:26:14Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ferrariklersone](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/ferrariklersone/32/15706_2.png) [@ferrariklersone](https://forum.katalon.com/u/ferrariklersone)\
**Post date:** [March 18, 2021, 9:41am UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/8 "2021-03-18T09:41:52Z")

</div>

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 !!!

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:31am UTC](https://forum.katalon.com/t/is-there-any-way-to-check-if-the-radio-button-or-check-box-is-selected-or-not-in-katalon/31782/9 "2022-08-08T07:31:39Z")

</div>

Archived on August 8, 2022, 7:31am UTC


