Need help in identifying the Xpath of dynamic element | Selenium Training|Java|WebDriver|TestNG|Frameworks|Videos

Need help in identifying the Xpath of dynamic element

N
Ningappa Post 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.

//div[starts-with(@id,'BiComponent-')]/table/tbody/tr[2]/td[text()='Report']

Full Xpath of all 6 elemnts looks like below

/html/body/div[8]/div[1]/table/tbody/tr[2]/td[2]

/html/body/div[16]/div[1]/table/tbody/tr[2]/td[2]

/html/body/div[22]/div[1]/table/tbody/tr[2]/td[2]

/html/body/div[28]/div[1]/table/tbody/tr[2]/td[2]

/html/body/div[32]/div[1]/table/tbody/tr[2]/td[2]

/html/body/div[38]/div[1]/table/tbody/tr[2]/td[2]

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

S

Instructor

Support Team Reply on 04/12/2019

Well you can use driver.findelements and extract all

And use the one which you want by the index

N
Ningappa Reply 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?

//div[starts-with(@id,'BiComponent-')]/table/tbody/tr[2]/td[text()='Report']

S

Instructor

Support Team 5 days go

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