Getting count of selecttag in a webpage

Ask general questions here.
kiran.pol
Posts: 12
Joined: Tue Oct 06, 2009 7:40 am

Getting count of selecttag in a webpage

Post by kiran.pol » Mon Jun 07, 2010 6:52 am

Hi,

I am trying to get the count of all selecttag in a webpage and i am using the below code .. but the count returns '0' even though there are selecttag in the webpage

Ranorex.WebDocument We1 = "/dom[@PageUrl~'^http://xyz/abc/']";
Console.WriteLine(We1.Find("./select").count);

Thanks
kiran pol

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

Re: Getting count of selecttag in a webpage

Post by Support Team » Mon Jun 07, 2010 8:31 am

Hi,
kiran.pol wrote:Ranorex.WebDocument We1 = "/dom[@PageUrl~'^http://xyz/abc/']";
Console.WriteLine(We1.Find("./select").count);
use ".//select" instead of "./select". ".//" identifies all elements that are descendants of the current element.
Please take a look to the documentation
http://www.ranorex.com/support/user-gui ... xpath.html
and our screen casts http://www.ranorex.com/support/screencasts.html
about to use the RxPath.

Regards,
Peter
Ranorex Support Team