我正在为一个网页做一个项目和楼宇自动化测试套件。网页的某一部分看起来是这样的。
相应的HTML如下:
<p class="customer-service">
<b>Try us out for 14 days. If you aren't satisfied, we'll refund your money.</b>
<br>
Our customer service team is available Monday to Friday,
<br>
8AM - 12AM (Midnight) EDT, via phone, email or live chat.
</p>
我想为“我们的客户服务团队周一到周五有空”的文字写一个XPath。特别是,我想验证相应行的自动化套件中的文本。是否有任何方法可以使用write ()或text()编写xpath?
我尝试了以下xpath
//p[@class='customer-service']/text()[2]
这就是结果。
发布于 2020-07-01 07:02:16
这将帮助您//p[@class='customer-service']/text()[normalize-space()][1]
https://sqa.stackexchange.com/questions/45114
复制相似问题