Page 1 of 1

getting all the tag elements of same kind

Posted: Wed Mar 31, 2010 12:32 pm
by edxxgardo
Hello,

Is there any way of getting (via C# and Ranorex API) all of the tag elements from a web page under test? For example, I want to get all the <input> or <select> tags in a list-like format.
Thanks in advance,

Dario

Re: getting all the tag elements of same kind

Posted: Wed Mar 31, 2010 1:34 pm
by Support Team
Hi Dario,

With the Ranorex Method Find you will get back a IList of all <tags> if you are using the correct RxPath.
e.g.
//Difference between to listDiv only the /body//div and body/div
//You get all "Children Children" div tags from the body down
IList<DivTag> listDiv = Host.Local.Find<DivTag>("/dom[@caption~'YourHomepage']/body//div");
//You get all "Children" div from the body
IList<DivTag> listDiv = Host.Local.Find<DivTag>("/dom[@caption~'YourHomepage']/body/div");
Regards,
Peter
Ranorex Support Team