Chrome: Can't find clickable select tag option in web page

Class library usage, coding and language questions.
Posts: 50
Joined: Mon Feb 13, 2012 5:52 pm

Chrome: Can't find clickable select tag option in web page

Post by lyn5000 » Tue Feb 28, 2012 1:22 am

I'm unable to find a clickable Ranorex.Adapter for the options in a web page select tag in the Chrome browser after clicking the select tag box.
I can find them in IE and Firefox.

(A) This finds the select tag and clicks and opens the box in the web page showing the options.

Code: Select all

Ranorex.SelectTag test = "/dom//select[@id='drpState']";
How do I find the Ranorex.Adapter that is clickable for the options shown in the select box after opening it? I can do it in IE and Firefox but not Chrome.

This will find a Ranorex.OptionTag. The specific option is visible on the screen but .Visible says false and focus or click fails.

Code: Select all

Ranorex.Unknown testChild = test.Children[5];
Or doing it an alternative way, this finds the container that is created after the above (A) code has executed however none of the options in the box on the web page can be found as children of this adapter (0 children) and also using Ranorex Spy with ctrl+Windows keys over a specific option in the open menu just selects the parent container (which shows no children in Spy).

Code: Select all

Ranorex.Container test3 = "/container[@caption='dropdown']";

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

Re: Chrome: Can't find clickable select tag option in web page

Post by Support Team » Wed Feb 29, 2012 10:10 am

Unfortunately, Chrome (and Safari) don't divulge any information about the option tag's position to Ranorex;
For single-select, I recommend setting the "TagValue" on the select tag, and for multi-select, set the "Selected" property to "True" on the option tags themselves.

If you need to simulate user input, then you also could focus the select tag and press left/right arrow key until you reach the correct value.

Ranorex Team