Timeline for How to find an element that may be in multiple xpath locations?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 20, 2017 at 7:30 | comment | added | Mayur | When you use findElements, it will return list of elements. So, you will have to use index. Example, in Java driver.findElements(By.xpath(xpath2)).get(0).getText() | |
Mar 17, 2017 at 22:24 | comment | added | Michael Durrant | Yes, updated for both queries to use findElements instead of findElement | |
Mar 17, 2017 at 22:23 | history | edited | Michael Durrant | CC BY-SA 3.0 |
added 2 characters in body
|
Mar 16, 2017 at 8:21 | comment | added | Mayur | driver.findElement(By.xpath(xpath1)) is null, it will throw exception and execution will not proceed. | |
Mar 14, 2017 at 20:12 | history | answered | Michael Durrant | CC BY-SA 3.0 |