I wanted to change the xpath of a element in that way that ranorex selects the root element depending on criteria s of a child element. I checked the xpath with multiple sites with a simple xml and it should work.
But in the ranorex spy the xpath is marked as invalid without showing a error message.
XPATH
//form[//text[@AccessibleName='Mark mixture as surface ?']]
Simple xml
<root xmlns:foo="http://www.foo.org/" xmlns:bar="http://www.bar.org">
<actors>
<actor id="1">Christian Bale</actor>
<actor id="2">Liam Neeson</actor>
<actor id="3">Michael Caine</actor>
</actors>
<foo:singers>
<foo:singer id="4">Tom Waits</foo:singer>
<foo:singer id="5">B.B. King</foo:singer>
<foo:singer id="6">Ray Charles</foo:singer>
</foo:singers>
<form>
<text accessibleName="Mark mixture as surface ?">
</text>
</form>
</root>
x path not working in ranorex spy
x path not working in ranorex spy
You do not have the required permissions to view the files attached to this post.
Re: x path not working in ranorex spy
Hi,
This is not valid xpath. You need to use xpath like this:
This is not valid xpath. You need to use xpath like this:
Code: Select all
/form//text[@AccessibleName='Mark mixture as surface ?']
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: x path not working in ranorex spy
Actually, it is a valid XPath according to the W3C XPath specification, but not a valid RanoreXPath. There are differences between XPath and RanoreXPath, since RanoreXPath is designed to work for more technologies than just web.odklizec wrote:This is not valid xpath.
One difference is that RanoreXPath does not support nested queries, that's why you have to rewrite nested queries as odklizec explained.
Regards,
Alex
Ranorex Team
Re: x path not working in ranorex spy
Hmm, ok.
Is there a documentation which xpath querries are supported by ranorex xpath ?
Regards
Florian
Is there a documentation which xpath querries are supported by ranorex xpath ?
Regards
Florian
Re: x path not working in ranorex spy
The documentation in the user guide should explain all functionality RanoreXPath supports (except for a description of non-abbreviated "axes" like "following-sibling" or "ancestor"):
https://www.ranorex.com/support/user-gu ... html#c3296
Regards,
Alex
Ranorex Team
https://www.ranorex.com/support/user-gu ... html#c3296
Regards,
Alex
Ranorex Team
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: x path not working in ranorex spy
Nested queries are something that I would really like to see incorporated into RxPath functionality. Please vote for it over at user voice
Doug Vaughan
Re: x path not working in ranorex spy
Interesting is that xpath expressions like
\\form\\component\\button seem to work in some cases. Its not not that the tool cannot execute that. Its just not working consistent
\\form\\component\\button seem to work in some cases. Its not not that the tool cannot execute that. Its just not working consistent
-
- Posts: 254
- Joined: Tue Mar 24, 2015 5:05 pm
- Location: Des Moines, Iowa, USA
Re: x path not working in ranorex spy
if you get an error saying something like "...[the object} is no button" Try changing \\form\\component\\button to \\form\\component\\buttontagfleipold wrote:Interesting is that xpath expressions like
\\form\\component\\button seem to work in some cases. Its not not that the tool cannot execute that. Its just not working consistent
Another point is that I'll place the form object itself in the repo as a rooted folder and add descendants to that hierarchy.
Doug Vaughan
Re: x path not working in ranorex spy
This path is very unspecific with all the "//" in there, so depending on the number of open applications, it could take a long time (even minutes) to search for that path. Consequently, you may need a high timeout value or a more specific path.fleipold wrote:Interesting is that xpath expressions like
\\form\\component\\button seem to work in some cases. Its not not that the tool cannot execute that. Its just not working consistent
You can easily check if a path returns the correct element by pasting it into the path search text box in Ranorex Spy.
Regards,
Alex
Ranorex Team