0

I have a DOM element with the following unique attribute

ui-sref=".carts.cart({type:'agent'})" 

so I need to define a XPath for Selenium to find this element.

I can use

//li[contains(@ui-sref,"carts") and contains(@ui-sref,"agent")]

and it works fine.

Can I use something like

//li[contains(@ui-sref,"carts"*"agent")
the Tin Man
  • 155,156
  • 41
  • 207
  • 295
Prophet
  • 21,440
  • 13
  • 47
  • 64
  • 1
    See https://stackoverflow.com/questions/21405267/xpath-using-regex-in-contains-function – user7294900 Oct 29 '18 at 17:48
  • Without Xpath, any element: `"']|"[^"]*"|'[^']*')*?\sui-sref\s*=\s*(?:(['"])(?:(?!\1)[\S\s])*?carts(?:(?!\1)[\S\s])*?agent(?:(?!\1)[\S\s])*\1))\s+(?:"[\S\s]*?"|'[\S\s]*?'|[^>]*?)+>` –  Oct 29 '18 at 21:03

0 Answers0