1

Sample text :

test > test's done> test's done again's done

The synatx I'm using to capture it :

$x("//*[contains(text(),....)

when I replace the dots with that text I get the below error

Uncaught DOMException: Failed to execute '$x' on 'CommandLineAPI': due to the use of special Characters

I tried escaping with \ and \' in each embedded ' which didn't work either

$x("//*[contains(text(),'test > test'\''s done> test'\''s done again'\''s done')]")
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Steve
  • 37
  • 1
  • 6
  • XPath doesn’t have any way of escaping special characters, Use double quotes instead of single quotes in the XPath expression `$x("//*[contains(text(),\"test > test's done> test's done again's done\")]")` – Wilfred Clement Jul 05 '20 at 10:34

0 Answers0