How Can i click on this element using XPATH in Web driver?

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2012-09-11T09:33:18Z Indexed on 2012/09/11 9:38 UTC
Read the original article Hit count: 276

Here is the html.....

<li>
<input type="checkbox" checked="" name="selectedMstrPrivGroupList[9].mstrAuthorities[0].status"/>
Add Dexter
</li>

How will I be able to click on this element. It is a check box. And I want to use XPath as I have close to 30+ checkboxes in the page, so that I can create a generic method and pass only the Webelement.. I tried the following but didn't work.

Driver.findElement(By.xpath("//input[contains(.,'Add Dexter')]")).click();

Please help!!

Thanks, Mike

© Stack Overflow or respective owner

Related posts about java

Related posts about selenium