Spent a while on this and so far I am not winning. Hopefully someone can help me.
I need to be able to select each option within a specified drop down list. Because of the way this page is built I must click on each option or the page will not refresh and trigger other things.
I have looked at a previous thread - http://www.ranorex.com/forum/how-to-sel ... -t998.html - This got me this far:
public void Select_Each_Option3() { Ranorex.SelectTag varSelect = repo.GroupcallMessengerRoot.SendMessage.Recipients.SendTo.dd_SendTo; foreach (OptionTag option in varSelect.Find(".//option")) { var varListItem = option.InnerText; varSelect.EnsureVisible(); varSelect.Focus(); varSelect.Click(Location.CenterRight, 1000); ListItem item = "/container[@caption='selectbox']/listitem[@text~'" + varListItem + "']"; item.EnsureVisible(); item.Focus(); item.Click(Location.Center, 1000); Report.Info("Selecting Item '"+varListItem+"' in "+varSelect); } }This will select a couple of options before failing while not being able to find an element.
I am also getting the following message in the log "Could not get a valid element rectangle from '{ListItem:None}', since the element is no longer valid. "
I guess what is happening is that the listitem list dosen't exist anyone once the selectbox is closed. I have reached the limiot of my c# knowledge and cant think of a way around the issue.
Can anyone offer a solution please?
Many thanks
Ben