Unable to click or check a check box


#1

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?


#2

I have the same problem.


#3

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

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

#4

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


#5

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:


#6

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.