![](/img/trans.png)
[英]How to click a button from a website with javascript and find that element through xpath and a specific text that the element contains?
[英]Using XPATH how to find a text and click on button
贝娄是我的元素:
我已经知道如何使用以下方法找到id='0'
:
.waitForElementVisible("//form[contains(@id, '0')]").
我目前的问题是如何在“<form”中识别“Excelente Contribuição”。我需要单击文本 Excelente contribuição。
我尝试先使用这个来识别元素,但不起作用:
.waitForElementVisible("//form[contains(@id, '0') and contains(text()='Excelente contribuição')]")
Bellow是我需要点击的按钮。
尝试使用此 XPath 来匹配@id
的form
和label
文本的div
:
//form[@id='0']//div[label[normalize-space()='Excelente contribuição']]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.