apostroph in RxPath

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
jabelshauser
Posts: 55
Joined: Thu Aug 23, 2007 12:00 pm

apostroph in RxPath

Post by jabelshauser » Mon Apr 15, 2013 9:45 am

how can an accessiblename which contains an apostroph used with RxPath?

attached a snaphot.
The Spy resolves this Element in different ways, this is incomprehensible
Image-0019.png
Spy with numeric treeitem-index
Image-0019.png (6.27 KiB) Viewed 963 times
Image-0018.png
After relaod a snaphot. Here the name is resolved ?!?
Image-0018.png (5.7 KiB) Viewed 963 times
Thanks jörg
Attachments
accessiblename with apostroph.rxsnp
snapshot
(142.94 KiB) Downloaded 160 times

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: apostroph in RxPath

Post by Ciege » Mon Apr 15, 2013 7:24 pm

Not sure why you got the 2 different XPaths in Spy, but both are correct.

The second one is just using a RegEx that has the "special" characters escaped.

You can tailor the XPath to you liking using and valid RegEx so that it is more readable and reusable for you.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: apostroph in RxPath

Post by Support Team » Tue Apr 16, 2013 2:33 pm

Hello,

The second path works since the single quote is escaped with another quote.
You could also use the following path to get your item:

Code: Select all

/form[@controlname='ContainerForm']//treeitem[@accessiblename='Device''s Signal Level too high']
It looks like that you saved a snapshot of your TreeItem and opened it afterwards.
At first, your TreeItem could be identified by its index since there are several TreeItems found.
Then, the TreeItem couldn't be found by its index but by its accessiblename instead.
That is the reason, why the RxPath of your element has changed.

Regards,
Markus (T)
.
Image