getting ALL <li> children from div
getting ALL <li> children from div
I am writing a method to get all the li children of an element, usually a div at runtime. I want to pass in the repo item info and get all the li elements that are currently available. I would love to be able to get to all children, grandchildren and greats... for a given div of the div at runtime. Is this possible? Thanks
Re: getting ALL <li> children from div
Hi,
Please post a Ranorex snapshot (NOT screenshot!) of the element in question. Generally speaking, it should be possible to get the list of all ‘li’ elements, but without seeing, at very least, the snapshot, it’s hard to say what xpath should you use.
Basically, this xpath should return all li elements from given div...
Thanks.
Please post a Ranorex snapshot (NOT screenshot!) of the element in question. Generally speaking, it should be possible to get the list of all ‘li’ elements, but without seeing, at very least, the snapshot, it’s hard to say what xpath should you use.
Basically, this xpath should return all li elements from given div...
And this should help you with creating a list of litags...//div//li
BTW, please do not post the same question multiple times. It does not help with faster answerIList<ranorex.litag> liList =
repo.path.to.divtag.elementInfo.CreateAdapters<ranorex.litag>();

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: getting ALL <li> children from div
I will try that. Thanks. The thing about a snapshot is that I want to be able to do this for any div...
I did not realize I could not delete this one when I added the other which seemed a better place for it.
I did not realize I could not delete this one when I added the other which seemed a better place for it.
Re: getting ALL <li> children from div
The code you gave will get LI direct children. I imagine it is not possible to get ALL li descendants?
Re: getting ALL <li> children from div
The xpath I provided should return all li tags found after any div tag. Unfortunately, without snapshot, it’s hard to tell if the xpath is the optimal one. The code should simply create a list of adapters for all li tags returned by the xpath.
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