1

I'm trying to click on element using below code and its working fine if variable does not have special characters.

Values that passed in variable are:

Product  Passed
Test Message -> Failed
Double Units 13/2" -> failed

I cannot go with partial text, because sometimes only difference between two element is special character.

String Answertoselect = ElementName.replaceAll("'", "\\\\'");
String selectanswer = Answertoselect.replaceAll(" ", "${nbsp}");
Ian Roberts
  • 120,891
  • 16
  • 170
  • 183
user3326175
  • 37
  • 2
  • 4
  • 8
  • 4
    XPath doesn't have an escaping mechanism - you can put single quotes in a double quoted string and vice versa, but it's impossible to put both single and double quote characters in the same xpath string literal. – Ian Roberts Apr 17 '14 at 19:52

0 Answers0