mercredi 25 novembre 2015

How to grab text corresponding to checkboxes in selenium webdriver?

I am using selenium webdriver to run script.

I have a scenario where I want to grab text corresponding to checkboxes.

For a single checkbox I am using getAttribute() to capture text as given in below code and it is working fine.

String referenceIn3DPage=Driver.driver.findElement(By.xpath("//div[3][@class='some-class']//input")).getAttribute("id"); 

Does getAttribute invalid in case of findElements() ?

How to capture text for multiple checkbox?

Screenshot of checkbox: enter image description here

HTML screenshot:

enter image description here

As you can see in screenshot I want the attribute - id to capture my text.




Aucun commentaire:

Enregistrer un commentaire