如何解决在XPath中使用正则表达式查找特定模式
我想在xpath中使用正则表达式查找特定文本。
这是我的xpath:
locator: //*[@class = 'android.widget.TextView' and contains(@text,'PriceBottomBarDialog-selector')]
此“ PriceBottomBarDialog-selector”保持不变,开始的文本不断变化。有人可以帮忙处理正则表达式吗?
谢谢
解决方法
你很近。您需要修复xpath,然后才能使用Locator Strategy:
-
Xpath:
locator: //*[@class = 'android.widget.TextView' and contains(.,'PriceBottomBarDialog-selector')]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。