Need help in identifying the Xpath of dynamic element | Selenium Forum
Ningappa Posted on 03/12/2019

Facing difficulies in finding xpth of one of the conext menu element in my application

Below Xpath i wrote but its still finding 6 elements.


Full Xpath of all 6 elemnts looks like below







Here Div tag has different value but all attributes are same for above 6 Div tag

So plese help here to find Xpath, i have attached screenshot as well

Support Team Replied on 04/12/2019

Well you can use driver.findelements and extract all

And use the one which you want by the index

Ningappa Replied on 04/12/2019

All 6 elements i am finding with help of below xPath contains the same text as Report, so how to find the one which i am lokking in to it?


Support Team Replied on 11/12/2019

You want the first one or Second one or which one?

Ningappa Replied on 18/12/2019

I want the element which exist in last one

Support Team Replied on 22/12/2019

List<WebElement> all = driver.findElements(By.xpath("/html/body/div[8]/div[1]/table/tbody/tr[2]/td[2]"));

WebElement sixthElement = all.get(all.size()-1)