Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Tue Oct 01, 2013 3:48 pm

This is still a problem any estimate on its resolution?

Regarding the slash issue mentioned above. Is the RxObject path provided by Ranorex Spy (such as:

/form[@controlname='SimpleUserAccessSettingsDialog']/container[@controlname='tableLayoutPanel1']//container[@controlname='btnOkay']/button[@accessiblename='&OK']

) incompatible with the RxObject path argument used in calls to Host.Local.FindSingle() and calls to Host.Local.Find() because the RX path provided by Spy has an initial slash? That might explain the bizarre behavior I am experiencing with the code below.

Most of the time both the call to

Code: Select all

var objectsFound = Host.Local.Find<Ranorex.Unknown>(objectPath, new Duration(waitTime));
and the call to

Code: Select all

var singleUnknownFound = Host.Local.FindSingle<Ranorex.Unknown>(objectPath, new Duration(waitTime));
Fail to find any controls; even though Spy find the control with no difficulty using the *EXACT* same object path. (FindSingle() of course throws an exception in response to the failure to find)

Then, for reasons I cannot discern, suddenly the call to

Code: Select all

var objectsFound = Host.Local.Find<Ranorex.Unknown>(objectPath, new Duration(waitTime));
will find 0 objects matching the given path, but the call to:

Code: Select all

var singleUnknownFound = Host.Local.FindSingle<Ranorex.Unknown>(objectPath, new Duration(waitTime));
will find 1 object; e.g. the OK button listed above.

Restart the machine and you are back to state where neither Host.Local.Find() nor Host.Local.FindSingle() find any objects at all even though neither the AUT nor the calling code have changed. There is some kind of caching issue within the Host.Local, I just wish I knew what is was.

The C# method which calls Host.Local is:

Code: Select all

    private void SeekISEControls()
    {
      string msgText;
      TimeSpan waitTime = new TimeSpan(0, 0, 0, 5); // 5 seconds
      string objectPath =
        @"/form[@controlname='SimpleUserAccessSettingsDialog']/container[@controlname='tableLayoutPanel1']//container[@controlname='btnOkay']/button[@accessiblename='&OK']"
      ;

      var objectsFound = Host.Local.Find<Ranorex.Unknown>(objectPath, new Duration(waitTime));
      int numFormsFound = objectsFound.Count;
      string suffixText = (1 == numFormsFound) ? "" : "s";
      msgText = string.Format("Found {0} object{1} matching the object path:\n{2}", numFormsFound, suffixText, objectPath);
      MessageBox.Show(msgText, "In-Sight Explorer: Host.Local.Find<Ranorex.Button>", MessageBoxButtons.OK);

      // if (0 < numFormsFound)
      {
        var singleUnknownFound = Host.Local.FindSingle<Ranorex.Unknown>(objectPath, new Duration(waitTime));
        msgText = string.Format("Found a single UNKNOWN object matching the object path:\n{0}", objectPath);
        MessageBox.Show(msgText, "In-Sight Explorer: Host.Local.FindSingle<Ranorex.Button>", MessageBoxButtons.OK);

        var singleButtonFound = Host.Local.FindSingle<Ranorex.Button>(objectPath, new Duration(waitTime));
        msgText = string.Format("Found a single BUTTON object matching the object path:\n{0}", objectPath);
        MessageBox.Show(msgText, "In-Sight Explorer: Host.Local.FindSingle<Ranorex.Button>", MessageBoxButtons.OK);
      }
    }
In the mean time, I will try slash-less RxObject paths in my calls to Host.Local.Find() and Host.Local.FindSingle().

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Tue Oct 01, 2013 4:12 pm

Perhaps this is related. Why do the two version of SPY provide different object paths to the same winform object within the same AUT?

Spy 32 bit provides an RX path of:

Code: Select all

/form[@controlname='SimpleUserAccessSettingsDialog']/container[@controlname='tableLayoutPanel1']//container[@controlname='btnOkay']/button[@accessiblename='&OK']
Spy 64-bit provides an RX path to the same object of:

Code: Select all

/form[@controlname='SimpleUserAccessSettingsDialog']/container[@controlname='tableLayoutPanel1']/?/?/container[@controlname='pnlLayout']/?/?/button[@accessiblename='&OK']
.

The application under test is a 32-bit winform application using the .NET 3.5 CLR, but is running on a 64-bit windows 7 machine. I will try this on a Windows 7 32 bit machine.

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

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by Support Team » Wed Oct 02, 2013 4:30 pm

Hello,

Do you have the full/extended version of .NET Framework 3.5 installed on your system?
Please take a look at our General Troubleshooting page for possible reasons for your issue.

Do you experience the same behavior on a different machine (e.g. Windows 7 32-bit)?
Please make sure that the 'Bit Bridge' in the settings is enabled.

Regards,
Markus (T)
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Thu Oct 03, 2013 3:43 pm

I will try this on other virtual machine / OS combinations.

I will ask the developers about the full/extended version of .NET Framework 3.5. How does one test that one has the truncated as opposed to full .NET 3.5?

Since Ranorex studio is not installed on my automation machines (only the Ranorex runtime DLL's are loaded) how do I set or disable the 32/64 bit bridge? Is there an API call to enable/disable the 32/64 bit bridge?

My primary interaction with Ranorex is to call the Ranorex API via C# code and *not* with the Studio. Though on the machine with Studio loaded the studio has the same failures to find as the runtime DLL.

I will get back with more information on these 3 questions.

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Fri Oct 04, 2013 2:49 pm

I am now getting a Ranorex Technology Limitation when I use the 64-version of Ranorex Spy.

This part of the General troubleshooting seems on point because it describes my issue (Spy finds, but Studio and Verifier do not)
Reason #5:
The .NET Framework 4.0 Extended package is needed but not installed. An indication for this problem typically is that controls can correctly be identified by the standalone Ranorex Spy application, but not by the integrated Ranorex Spy or Recorder in Ranorex Studio.The application under test uses the .NET Framework 4.0 and you may get Technology Limitation pop-ups saying that specific assemblies cannot be loaded.

Solution:

Either install the .NET Framework 4.0 Extended or if that is not possible always use the standalone Ranorex Spy and Recorder tools instead of the integrated ones in Ranorex Studio.
But when I try to install the 4.0 extended .NET I get:
Same or higher version of .NET Framework 4 has already been installed on this computer.
because I have .NET 4.5 installed as part of VS2010.

Still digging as to why this failure to find is so intermittent.

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

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by Support Team » Mon Oct 07, 2013 8:53 pm

Hello John,

Thank you for the information. In .NET 4.5 the Client Profile is no longer available. So it should not be necessary to install another .NET Framework. Just for analyzing the issue, would it be possible to uninstall .NET 4.5 and install .NET 4.0 extended/full on your machine?

It is possible to enable/disable the BitBridge using the property "EnableBitBridge". Please take a look into our online API documentation in order to get a detailed description about this property.
Thank you!

Regards,
Bernahrd
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Wed Oct 30, 2013 5:11 pm

I found a work around. Permit Ranorex 4.1.0 more time to find the object. The call to Host.local.Find() and host.local.FindSingle() can take anywhere from 1-2 seconds or 50-60 seconds (with nothing in between) to find the troublesome control.

I am not sure what cause such wide variability in the object searching, but it is there. If FindSingle() finds the object quickly, then it finds it in 1-2 seconds. Average for the path below is 1.1 seconds. If FindSingle() finds the object slowly, then it finds it in 50-60 seconds. Average for the path below is 53 seconds.

This variability is only with some widgets. Most windows widgets in the AUT can be found very quickly (sub-second). A few though have a definite schism between "fast" and "slow" and I don't know what factors cause the object identification to be about a minute for some executions and 1-2 seconds for other executions.

The work around is to accommodate the "slow" find on the troublesome few controls.

For example: with either object path to the same slider control the runtime call to Host.local.FindSingle() will eventually find the slider bar.

Code: Select all

/form[@controlname='EasyBuilderJobSizeDialog']/?/?/container[@controlname='panel1']/?/?/slider[@controlname='sliderActiveCells']

Code: Select all

/form[@controlname='EasyBuilderJobSizeDialog']/container[@controlname='tableLayoutPanel2']/container[@controlname='panel1']/container[@controlname='tableLayoutPanel1']/slider[@controlname='sliderActiveCells']
The second Rx path is the same as the first Rx path, but with the replacement of each /?/?/ ellipsis with the table layout panel that that ellipsis covers.

Spy and Host.Local.FindSingle() both eventually find the slider (or buttons on the same form) with either RX path and both tools and paths have the same bifurcation with either tool; sometimes slow sometimes fast with no discernible pattern.

Until the object identification engine has a search duration with a narrower standard deviation, my work around is to widen the search time out for the controls Host.Local.FindSingle() sometimes has trouble finding quickly.

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 10:40 am

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by Swisside » Thu Oct 31, 2013 10:26 am

I had the same problem (even after simplifying paths as much as possible) and came up with the same solution : set very high search timeouts for the problematic items (mainly comboboxes or rawtext for me)

Still, it is strange that Spy can recognize the item easily but then it doesn't find the item when you run the test. Quite worrisome to be honnest.

Have a nice day

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Thu Oct 31, 2013 8:29 pm

Regarding the 32/64 bit bridge.

Is there an *further* documentation on the property? I cannot create an application in VS2012 that can access this configuration flag. EnableBitBridge is an instance member, but there are no constructors for

Code: Select all

Ranorex.Core.Configuration.PluginsConfig
or

Code: Select all

Ranorex.Core.Configuration.PluginsConfig.Win32Config
and the only public constructor for

Code: Select all

Ranorex.Core.Configuration 
requires an argument:
Configuration parent;

Is there a sample application in C# that accesses this property at run time? From the API documentation linked below, this property is not available to a C# program that uses the Ranorex runtime DLL's to find objects.

The documentation of Ranorex.Core.Configuration.PluginsConfig.Win32Config is here: http://www.ranorex.com/Documentation/Ra ... onfig.htm

On EnableBitBridge in particular is here.
http://www.ranorex.com/Documentation/Ra ... Bridge.htm

The only other URL that comes up in a google search of the Ranorex site for the phrase EnableBitBridge is the tutorial.

htrudel
Posts: 8
Joined: Tue Oct 29, 2013 8:40 am
Contact:

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by htrudel » Thu Oct 31, 2013 11:05 pm

I've had this kind of problem testing our 32 bits 2.0 .NET application and our solution was to set the Ranorex project "Target CPU" to "32-bit Intel-compatible processor" (option found in project properties under compiling tab).

Hope this helps.
Hugo Trudel
Software Engineer
Distech Controls Inc

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

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by Support Team » Fri Nov 08, 2013 4:11 pm

Hello JohnWashburn,

Unfortunately there is no further documentation how to enable the Bit Bridge in user code, but you can enable the bit bridge using the following code line:
Ranorex.Core.Configuration.Current.Plugins.Win32.EnableBitBridge = true;
I hope that help solving your issue.

Regards,
Bernhard
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Tue Nov 26, 2013 4:34 pm

Thanks I will try that.

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Wed Dec 11, 2013 2:35 am

This still is a consistent behavior of 4.1.0. I am uploading to the FTP site a simple C# program which uses Host.Local.FindSingle() to drive a second app.

The driver app cannot find the same widget that Ranorex Spy can find. You will need a trial version of Telerik controls in order to run the driven application. The trial version of the Telerik controls for WinForms is found at: http://www.telerik.com/products/winforms/download.aspx

The machine information is that I am running this on a Windows 7 64-bit Intel i7 machine.

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Wed Dec 11, 2013 9:04 pm

Also the application/demo uploaded to the FTP site wil fail even if the object to find is the top level form. This is the case where using the RxPath:

/form[@controlname='TelerikWhetstone']

Spy can locate the top level form, but the call to Host.local.FindSingle() cannot find the form.

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Ranorex Studio 4.1.0 cannot find objects that Spy can find.

Post by JohnWashburn » Wed Dec 11, 2013 9:08 pm

At this point I am rolling back to 4.0.8 because the object ID technology used by Spy and the object ID technology used by the Studio / Run-time at least *agree* on what controls can and cannot be located.