Page 1 of 1

Ranorex Can't find excel controls

Posted: Wed Mar 28, 2012 6:30 pm
by AppTester
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.

Code: Select all

            Process.Start("C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE");
            Ranorex.TitleBar ttbExcel = LightningUIItems.ttbExcel; 
            ttbExcel.MoveTo();
In the LightningUIItems class I create the ttbExcel (titlebar) object like this:

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;                      
    		}                               
    	}
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?

Re: Ranorex Can't find excel controls

Posted: Thu Mar 29, 2012 3:56 pm
by Support Team
Hi,

Do you really mean Excel 2012, because Excel 2012, which belongs to Office version 15, is not yet released?
Can you send us a Ranorex Snapshot file of the application?
Following link will show you how to generate a snapshot file.

Regards,
Markus
Ranorex Support Team

Re: Ranorex Can't find excel controls

Posted: Thu Mar 29, 2012 6:51 pm
by AppTester
Thank you for your reply. After further investigation I figured out the problem. The issue was on my end, with mycode, not a Ranorex problem.