下面是我尝试为其编写 XPath 的元素<div class="displayInlineBlock Roman30Px_New bsbAccountFont ng-binding">123456</div>
上面的元素在页面上很多,可以使用末尾的值来区分,即 123456。
我尝试过的 XPath 是这种方式,在尝试时我发现有一个包含值 123456 的 innerText。//*[@class='displayInlineBlock Roman30Px_New bsbAccountFont ng-binding']
我不确定如何为我输入的每个特定值单击此元素。
我尝试过的其他几种方法是xpath=from_frst_part=//div[innerText='123456'']/innerText
但没有任何效果。
我在想的另一种方法是查找页面上的元素数量并获取属性,但我觉得它又长又麻烦。
最佳答案
我认为合适的 xpath 也可以是这样,通过使用 and
关键字而不是将属性分隔到单个括号中://div[@class='displayInlineBlock Roman30Px_New bsbAccountFont ng-binding' and text()='123456']
关于android - 例如 : I would want to write an xpath that would click an element based on the input value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59496131/