vendredi 25 septembre 2015

How can i fix my checkbox click in Selenium Webdriver with Java?

I am using Selenium in Java to test the checking of a checkbox in a webapp. Here's my code:

WebElement checkBox1;
checkBox1 = driver.findElement((By.xpath(xpathOfElement)));
checkBox1.click();

The Selenium Webdriver find the checkbox's position, but for some reason it does not click on. Only checkbox's area becomes gray, but the checkbox will not be active.

Here is relevant parts of my HTML:

<div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default">
<span class="ui-chkbox-icon ui-icon ui-c ui-icon-blank"></span>
</div>

How can I solve this problem in Selenium WebDriver with Java? Will be grateful for any help.




Aucun commentaire:

Enregistrer un commentaire