Page 1 of 1

XPath quotation characaters

Posted: Wed Mar 10, 2010 11:56 am
by atom
Hiya

I have a ranorex xpath for a window, whos title contains a single quote ' character
How can i escape that character in the xpath?

According to XPath 1.0 specification, attributes can be specified in double or single quotes
But it seems ranorex xpath only allows single quotes

e.g.
/form[@title='That's my window'] -> fails because of single quote in window title
/form[@title="That's my window"] -> doesnt work, but should according to xpath specification

Is there any function to take a string (window title), and escape all special xpath characters?

Cheers

[update]
/form[@title='That's my window'] -> also fails

Re: XPath quotation characaters

Posted: Wed Mar 10, 2010 12:45 pm
by Support Team
Hi atom,
double quote should fix your problem! ;)
You can easily checkout yourself if you use Ranorex Spy and tracking e.g. a textbox with a quote in it and looking to the related xpath.

Best regards,
Christian
Support Team