简体   繁体   English

在元素的子选项卡中时如何获取元素的XPath(Salesforce Lightning组件)

[英]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 . 在以下代码段中,“帐户”表最后一列中的下拉元素的XPath在“子标签”和“ 主页”中相似。

I am using the XPath expression 我正在使用XPath表达式

//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]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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