I am having an issue with Ranorex not clicking on an object and cannot understand what is wrong.
The code below is pretty much a direct port of code from another module I have written which reads the options in a form select list, locates the one matching the required value and clicks on it. The only difference is that the other module is looking at a pop up window and this one is looking in the main browser.
The general loop of this works and it will go through each option in the list and find the correct one (i've put breakes in and it is on the right option), however when it tries to click instead of clicking in the centre of the option (like the other code does) it clicks in the top left-hand corner of the screen. It seems to have no idea where the option is to click on it.
Any ideas or am I having a moment?!

Code: Select all
SelectTag myDNList = repo.BTIA2.Ctl00CphMainLstService;
IList<Ranorex.OptionTag> myDNOptions = myDNList.FindDescendants<Ranorex.OptionTag>();
int myDNCount = myDNOptions.Count;
bool myDNFound = false;
dialledNumber = "01234567890";
foreach (Ranorex.OptionTag thisDNOption in myDNOptions) {
if (thisDNOption.InnerText.Contains(dialledNumber)) {
myDNFound = true;
thisDNOption.Click();
break;
}
}