Ranorex Can't find excel controls

Ask general questions here.
AppTester
Posts: 20
Joined: Thu Sep 29, 2011 12:11 am

Ranorex Can't find excel controls

Post by AppTester » 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.

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Ranorex Can't find excel controls

Post by Support Team » Thu Mar 29, 2012 3:56 pm

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
.
Image

AppTester
Posts: 20
Joined: Thu Sep 29, 2011 12:11 am

Re: Ranorex Can't find excel controls

Post by AppTester » Thu Mar 29, 2012 6:51 pm

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.