简体   繁体   中英

Finding a specific pattern using regex in xpath

I want to find a specific text using regex in a xpath.

This is my xpath:

locator: //*[@class = 'android.widget.TextView' and contains(@text,'PriceBottomBarDialog-selector')]

This "PriceBottomBarDialog-selector" remains constant, the beginning text keeps changing. Can anyone please help with the regex pattern?

Thank you

You were close. You need to fix up the and you can use the Locator Strategy :

  • Xpath:

     locator: //*[@class = 'android.widget.TextView' and contains(.,'PriceBottomBarDialog-selector')]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM