问题描述
我想在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')]