Hi. how to get second specific child. now i am doing this from user code like this:
Host.Local.Find<RawText>("/form[@controlname='MainForm']//tree[@controlname='ObjTree']/rawtext[@rawtext='1_01_19']")[1]
how can i do this in repository?
How to get second child
Re: How to get second child
Hi,
Please upload a Ranorex snapshot (NOT screenshot) of the tree element, so people here at forum can analyse it a suggest best approach. Thanks.
Please upload a Ranorex snapshot (NOT screenshot) of the tree element, so people here at forum can analyse it a suggest best approach. 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
Re: How to get second child
here it is
You do not have the required permissions to view the files attached to this post.
Re: How to get second child
Hi,
Thanks for the snapshot. At first, the xpath you are using in code, does not correspond with the snapshot you posted. It seems that there is no ControlName attribute, either for form and tree element. Just 'name', so the path should look like this:
And unless I'm not missing something, this is also the xpath you can use in repo. Or do you want to find something else?
BTW, you don't have to use rawtexts, because the tree element, with all its elements and entire hierarchy, is available as standard tree element... So the xapth with tree element, instead of rawtext, looks like this:
Thanks for the snapshot. At first, the xpath you are using in code, does not correspond with the snapshot you posted. It seems that there is no ControlName attribute, either for form and tree element. Just 'name', so the path should look like this:
Code: Select all
/form[@name='MainForm']//tree[@name='ObjTree']/rawtext[@rawtext='1_01_19']
BTW, you don't have to use rawtexts, because the tree element, with all its elements and entire hierarchy, is available as standard tree element... So the xapth with tree element, instead of rawtext, looks like this:
Code: Select all
/form[@name='MainForm']//tree[@name='ObjTree']//treeitem[@name='1_01_19']
You do not have the required permissions to view the files attached to this post.
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: How to get second child
I need Rawtext because treeitem has a big picture and I need to click on the text exactly
Re: How to get second child
Hi,
So the xpath I provided (to RawText) worked for you?
So the xpath I provided (to RawText) worked for you?
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: How to get second child
Hi. if you try to find element with your rxpath in my snapshot you will find two elements. but i need only second
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: How to get second child
Hi IvanT,
Try adding a [2] at the end of the RxPath (this will select the [N] returned element).
Cheers,
Ned
Try adding a [2] at the end of the RxPath (this will select the [N] returned element).
Cheers,
Ned