XPath to multiple elements

Class library usage, coding and language questions.
stuntmanx
Posts: 2
Joined: Wed Sep 25, 2013 8:33 pm

XPath to multiple elements

Post by stuntmanx » Wed Sep 25, 2013 8:39 pm

I have a relative XPath which results in multiple elements. I tried this in the Ranorex Spy.

What I want to do is to get all those elements in the code module and list some attributes of each element.

I could not find the answer to this when I searched for it. If someone could point me in the right direction, it would be greatly appreciated.

EDIT: This is the line I am using now. It doesnt give any results but I do see some elements in the Ranorex Spy with the same path.

Code: Select all

 IList<Ranorex.Core.Element> buttonList = Host.Local.Find(rxPath,500);  

stuntmanx
Posts: 2
Joined: Wed Sep 25, 2013 8:33 pm

Re: XPath to multiple elements

Post by stuntmanx » Thu Sep 26, 2013 7:23 pm

I figured out my problem. Just in case anyone else encounters the same one.

Find works with multiple elements just fine but I had '/?/' in the path which worked for me in the spy but didn't in the code module. I replaced it with /Form/ and it worked perfectly.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: XPath to multiple elements

Post by Support Team » Fri Sep 27, 2013 11:01 am

Hello,

Thank you for providing your solution.

Regards,
Bernhard