Ranorex Can't find excel controls
Posted: Wed Mar 28, 2012 6:30 pm
All I'm trying to do is click the minimize, restore, or close button on the top right corner of Excel 2012. No matter what I try, Ranorex cannot find the the control and I keep getting the error in the report that the path cannot be found.
In the case below, I'm just trying to move the mouse to the title bar.
In the LightningUIItems class I create the ttbExcel (titlebar) object like this:
The path is the same from both spy and the recording. I have only one instance of excel open, and I make sure that no other excel processes are open and running in the background. But Ranorex always stops and gives the error. The same thing happens with the minimize, restore or close buttons.
Is any one able to please help with this problem? Why would this work in a recording, but not the way I do it?
In the case below, I'm just trying to move the mouse to the title bar.
Code: Select all
Process.Start("C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE");
Ranorex.TitleBar ttbExcel = LightningUIItems.ttbExcel;
ttbExcel.MoveTo();
Code: Select all
public static Ranorex.TitleBar ttbExcel
{
get
{
Adapter.DefaultSearchTimeout = 5000;
Ranorex.TitleBar ttbExcel = "/form[@processname='EXCEL']/element[@class='EXCEL2' and @instance='0']/container/element/element/container/titlebar[@accessiblename='']";
return ttbExcel;
}
}
Is any one able to please help with this problem? Why would this work in a recording, but not the way I do it?