# Unable to click or check a check box

**URL:** <https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [January 18, 2018, 8:53pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934 "2018-01-18T20:53:12Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maryann\_Croff](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@Maryann\_Croff](https://forum.katalon.com/u/Maryann_Croff)\
**Post date:** [January 18, 2018, 8:53pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/1 "2018-01-18T20:53:12Z")

</div>

Hi,  
I used Record Web to create objects for my web UI product. I have a check box that appears to be properly created with tag/id/label and xpath. The xpath is relative //\*[@id=“select-all”]. When I use Spy Web and capture the object and then use the Verify and Highlight button I get the message Found 1 element using XPath Selector. The problem is when I run the test, the item step passes (it clicks or checks) the element but the check box isn’t actually checked. I have used the inspector in chrome to try to find a better xpath but no luck so far. I can use the Verify Element Checked or Not Checked and it works properly. I must be close. Any advice?

---

<div class="post-metadata">

**Author:** ![Luis\_alberto\_guzman2](https://avatars.discourse-cdn.com/v4/letter/l/0ea827/32.png) [@Luis\_alberto\_guzman2](https://forum.katalon.com/u/Luis_alberto_guzman2)\
**Post date:** [January 19, 2018, 12:44am UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/2 "2018-01-19T00:44:15Z")

</div>

I have the same problem.

---

<div class="post-metadata">

**Author:** ![Vicente1](https://avatars.discourse-cdn.com/v4/letter/v/34f0e0/32.png) [@Vicente1](https://forum.katalon.com/u/Vicente1)\
**Post date:** [August 24, 2018, 2:17pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/3 "2018-08-24T14:17:49Z")

</div>

hey buddies, don’t know if it’s late but I had the same problem and I solved it with this:

```auto
WebUI.sendKeys(findTestObject('Customer/Customer SignUp Page/acceptTermsCheck'), Keys.chord(Keys.SPACE))

```

---

<div class="post-metadata">

**Author:** ![jean.ressouche](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jean.ressouche/32/1124_2.png) [@jean.ressouche](https://forum.katalon.com/u/jean.ressouche)\
**Post date:** [January 14, 2019, 1:00pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/4 "2019-01-14T13:00:32Z")

</div>

The issue is still present in the latest version (5.10.1)

---

<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:** [January 14, 2019, 2:09pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/5 "2019-01-14T14:09:06Z")

</div>

> [@Maryann\_Croff](#):
>
> When I use Spy Web and capture the object and then use the Verify and Highlight button I get the message Found 1 element using XPath Selector. The problem is when I run the test, the item step passes (it clicks or checks) the element but the check box isn’t actually checked.

There is one huge difference when comparing manual steps carried out by a human to automation steps carried out by code. _Speed_.

Are you absolutely certain that your test has waited until the elements are ready to be automated?

If you have made very effort to ensure the elements are ready, then follow this advice and provide us with more information:

> [@\[TIP\] How To Help Us Help You!](http://forum.katalon.com/t/tip-my-test-is-broken-nothing-works-please-help-me/12919):
>
> My test is BROKEN! NOTHING WORKS! HELP ME! Relax. We get it. We really do. There are some pretty smart and clever people on this forum, but you must realize, they are not magicians or wizards or gods. They cannot see your code, they can’t see your errors and they don’t even know what your AUT is meant to do even though it might seem perfectly obvious to you. So please relax and follow the advice below, before you start writing your post. The advice below will tell you the exact information …

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [January 14, 2019, 5:47pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/6 "2019-01-14T17:47:52Z")

</div>

> [@Russ\_Thomas](#):
>
> Are you absolutely certain that your test has waited until the elements are ready to be automated?

You can verify this very quickly by putting a Thread.sleep(5000) (or WebUI.delay(5000)) just before the line of code where you’re trying to click the checkbox. If it successfully clicks the checkbox after the delay, then Russ is correct, you need to properly wait for the DOM to be ready with a custom wait condition (do not use the sleep or delay from above, these were just to triage the issue).

If the checkbox _still_ doesn’t get checked, then it’s likely due to a disagreement between your test code and the HTML of the page, in which case we need more information from you.

---

<div class="post-metadata">

**Author:** ![komil.shukurov](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/komil.shukurov/32/16103_2.png) [@komil.shukurov](https://forum.katalon.com/u/komil.shukurov)\
**Post date:** [April 21, 2021, 2:35pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/7 "2021-04-21T14:35:52Z")

</div>

It’s 2021 and this issue still exists, some of the CheckBoxes it checks and some it doesn’t. I have tried a lot of different things, such as using different locators, scrolling to the element, delaying for 5 seconds. nothing works

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [April 21, 2021, 3:16pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/8 "2021-04-21T15:16:10Z")

</div>

Have you investigated if the **checkboxes** have the same id but are unique based upon another attribute, like **value** (such as True and False)? For these, you need to have the combo of attributes to uniquely identify them. I have also found I have to put **wait** statements or **delays** in my TCs until the element is “ready”.

Also, do you use, `WebUI.verifyElementChecked(findTestObject('TO'))` after setting the check on the element?

---

<div class="post-metadata">

**Author:** ![komil.shukurov](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/komil.shukurov/32/16103_2.png) [@komil.shukurov](https://forum.katalon.com/u/komil.shukurov)\
**Post date:** [April 21, 2021, 3:23pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/9 "2021-04-21T15:23:58Z")

</div>

Yes, I have tried to use attributes as well as CSS locators, and also this Checkbox is the only one in that block, and every time when I click “Verify and Highlight” it clearly hightlights this box and nothing else. And I do use `WebUI.verifyElementChecked(findTestObject('TO'))`, after my checkbox and that’s where test fails.

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [April 21, 2021, 5:21pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/10 "2021-04-21T17:21:30Z")

</div>

How about showing some HTML and this part of your script if you are able?

---

<div class="post-metadata">

**Author:** ![komil.shukurov](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/komil.shukurov/32/16103_2.png) [@komil.shukurov](https://forum.katalon.com/u/komil.shukurov)\
**Post date:** [April 21, 2021, 8:51pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/11 "2021-04-21T20:51:42Z")

</div>

Thank you for your time and help, I really appreciate it. I used:

WebUI.sendKeys(findTestObject(‘Customer/Customer SignUp Page/acceptTermsCheck’), Keys.chord(Keys.SPACE))

and it seems to work. So, I don’t think there was an issue with my locators or DOM, no idea what the issue is, but I am using this workaround for now. Thanks again

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [April 21, 2021, 8:54pm UTC](https://forum.katalon.com/t/unable-to-click-or-check-a-check-box/8934/12 "2021-04-21T20:54:36Z")

</div>

Since you only have the one key, you might get away with just using:  
`WebUI.sendKeys(findTestObject('Customer/Customer SignUp Page/acceptTermsCheck'), Keys.SPACE)`
