By changing my click method from models.click() to models.click(new Location()) I can expand the drop down finally.
Now my code can get the list of items using your code: IList<Ranorex.ListItem> optionList = Host.Local.Find<Ranorex.ListItem>("/container[@caption='selectbox']/listitem");

So far so good.

However after the first iteration in the loop, it no longer selects the items in the drop down. Rather it goes to the browser tool bar and does a right click and opens the browser menu.

We had some issues using the UI and Ranorex to access a dropdown menu on an html page. Typically when setting the xpath (RanorexPath) for web elements that we want to interact with - we will expose the elements on the application and then use the Track feature in the Ranorex Repository or the Spy Tool to get the xpath.

Using the Track feature in the Ranorex Repository was difficult as the dropdown menu will close when the Track button is pressed. We looked at setting the xpath using the Spy Tool - we were able to get a valid xpath but it did not behave as expected - selecting the menu option?

It was then I started to look at using the DOM to access the dropdown menu.

With the RanoreXPath using the native adapter failing - we have implemented a solution that will access the DOM and iterate the dropdown menu options and operate on them.

The user will pass the xpath of the dropdown control, the container where the menu items are located and the index of the selected item. The dropdownXPath is used to get the dropdown SelectTag object. The containerXPath is used to get the container of menu items that are loaded into a ListItem collection object. The menuListItemIndex is used to get the menuItem from the ListItem collection. The SelectTag object is used to open the dropdown control. The menuItem is used to operate on the menu item - in this case Click().

Below is the call to SelectDropdownMenuItem() and the implementation below ...

You can track menu/drop-down items by using either of the following options:

1. Press the "Ctrl-LWin" key combination ("Instant Tracking") while the mouse is over the desired object.

2. Click the "Track" button like you were doing and the press and hold "F12" ("Override") until you get the menu/drop-down open to where you want it. Then release "F12" and click the object you want to track.

As far as operating on drop-down select tag elements in different browsers, I have had more luck with using keyboard-up/down keys than using the mouse because each browser implements the drop-down slightly differently so you won't be able to get a consistent XPath to the list items.