Reputation: 187
I have a XPATH:
"//*[@id='TEST_0'][disabled=""]"
But I am getting error at the end ") required". Is there a way we can handle double quotations with in xpath?
Upvotes: 2
Views: 12207
Reputation: 163262
Why not just write
"//*[@id='TEST_0'][disabled='']"
It only starts to be a problem when you need both double and single quotes.
Upvotes: 2
Reputation: 389
you can do it this way
"//*[@id='TEST_0'][disabled="\""\"]"
Example :
System.out.print("\"Hello\"");
This will print: "Hello" in double qoutes
Upvotes: 0
Reputation: 187
Thanks for you suggestion. It did work
("//*[@id='Test_0'][disabled=" + "\"\"" + "]");
Upvotes: 0
Reputation: 16201
That's actually related to language you are using. Use (\) escape character
Upvotes: 2