I want to get a container that his have a button that have attribute @Text= 'Button1'
How to experess this XPATH ,i try a lot of ,but alway raise expection 'Invalid RXPATH'
How to express this Xpath
Re: How to express this Xpath
I understand now,
this can use the xpath 'axis' to get it,
for this question we can use like this '.....container/button[@Text='button3']/parent::*'
this mean select current node parent(container)
But,this only for parent,
if no the parent node,like this:
'.../treeitem/container/container[2]/treeitem[2]/container/container[@caption='abc123']'
if want to search treeitem that it have sub item 'container 'that have @caption='abc123',
I don't know how to get it!
this can use the xpath 'axis' to get it,
for this question we can use like this '.....container/button[@Text='button3']/parent::*'
this mean select current node parent(container)
But,this only for parent,
if no the parent node,like this:
'.../treeitem/container/container[2]/treeitem[2]/container/container[@caption='abc123']'
if want to search treeitem that it have sub item 'container 'that have @caption='abc123',
I don't know how to get it!
Re: How to express this Xpath
Hi,
Please upload a Ranorex snapshot (not screenshot) of the element in question. It's pretty hard to suggest something reliable without seeing at LEAST snapshot. If you need help from the community (or Ranorex support), please provide as much details as possible, including Ranorex snapshot or small sample app. Ranorex snapshot helps us to understand your problem and provide quick and reliable answer. Thanks.
Please upload a Ranorex snapshot (not screenshot) of the element in question. It's pretty hard to suggest something reliable without seeing at LEAST snapshot. If you need help from the community (or Ranorex support), please provide as much details as possible, including Ranorex snapshot or small sample app. Ranorex snapshot helps us to understand your problem and provide quick and reliable answer. Thanks.
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
-
- Posts: 56
- Joined: Wed Jun 10, 2015 4:35 pm
Re: How to express this Xpath
Rather using @ we can also write xpath as //container[button[text()='Button1']]
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: How to express this Xpath
That won't work with RanoreXPath, which is actually just a subset of XPath and does not support nested queries.satishmohan wrote:Rather using @ we can also write xpath as //container[button[text()='Button1']]
Regards,
Alex
Ranorex Team
Re: How to express this Xpath
./treeitem/container/container[2]/treeitem[2]/container/container[@caption='abc123']/../..
.. = parent, so you can go back to the parent of the parent. Similar to folders in command mode (DOS)
If you have not read this yet, do yourself a favor and read this (I've printed it out and have it by my desk).
http://www.ranorex.com/support/user-gui ... xpath.html
Scroll down and see the section "Advanced RanoreXPath Example"
Aracknid
.. = parent, so you can go back to the parent of the parent. Similar to folders in command mode (DOS)
If you have not read this yet, do yourself a favor and read this (I've printed it out and have it by my desk).
http://www.ranorex.com/support/user-gui ... xpath.html
Scroll down and see the section "Advanced RanoreXPath Example"
Aracknid