简体   繁体   中英

How to get XPath of an element when it is in sub tab (Salesforce Lightning component)

In the following snippets, XPath for the drop down element in last column of accounts table is similar in Subtab and Main page .

I am using the XPath expression

//table/tbody/tr[2]/td[10]/span/div/a[2][@role="button"]

to click on drop down element. But unable to do so as it happens to appear in the previous page too.

Please help me in identifying unique irrespective of tabs.

您可以使用此XPATH:- (//table/tbody/tr[2]/td[10]/span/div/a[2][@role="button"])[1]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM