Page 1 of 1

How to count DOM in the host?

Posted: Thu Jun 27, 2013 12:56 pm
by AutomationTester
Dear Support team,

How to count the DOMs in the host? like, using foreach loop or any mechanism. I have attached a snap and a Ranorex snapshot of this problem.
Urgent help needed.

Thanks
Amiruddin aka Automationtester
imgSnap.png

Re: How to count DOM in the host?

Posted: Fri Jun 28, 2013 11:06 am
by Support Team
Hi,

You could for instance search for all the dom objects using the following code:
IList<WebDocument> list = Host.Local.Find<WebDocument>("/dom");
Report.Info("Count: " + list.Count);
foreach(WebDocument web in list){
            Report.Info("Domain: " + web.Domain);
}
I hope this what you are searching for.

Regards,
Markus