In this section, find causes and solutions for limited object recognition that are not covered by other technology-specific pages.
- .NET WinForms
- .NET WPF
- .NET Silverlight
- Java
- Delphi
- Win32-based applications
- Microsoft Internet Explorer
- Image-based automation
- Geometry-related issues
- Windows 8 UI apps
- Mobile
- Miscellaneous
.NET WinForms
There are various reasons why object recognition may be limited when working with WinForms.
Insufficient privileges
Solution: Restart all Ranorex tools and the AUT with the same privileges, preferably as an administrator.
Insufficient security rights
This can be the case when you start the test executable and/or the AUT from a network drive or encrypted folder.
Solution: Copy both the executable build and the AUT to a folder on the desktop of the machine you want to run the test on.
Mixed-mode executable/obfuscated controls
The controls that can’t be identified are implemented in a mixed-mode executable (not DLL). These are often created by obfuscating applications or assembly merging utilities. The .NET Framework doesn’t support loading such mixed-mode executables in other processes, which is why Ranorex Studio and its tools cannot recognize such controls.
Solution: As a workaround, you can try to automate the non-obfuscated version of your application.
AUT and test executable target different platforms/processors
The controls that cannot be identified are implemented in an assembly that targets a particular platform/processor, while the test executable targets a different platform/processor. This causes isses on 64-bit operating systems, as the test executable can’t load such assemblies.
Solution: Try changing the Target CPU (Ranorex Studio) or Platform Target (Visual Studio) option in the automation project settings to match the target of the automated application as described ⇢ on this page. If you don’t know the target CPU/platform of the automated application, first try Any processor or Any CPU, respectively. If this doesn’t work, try the remaining options.
.NET WPF
There are various reasons why object recognition may be limited when working with WPF.
UIAutomation element selected instead of WPF element
While selecting an element of a WPF application in the element tree of Spy, you selected the UIAutomation tree of that application.
Solution: The preceding sibling of the selected window will identify the same window, but provide the “WpfElement” capability instead of “UiAutomation”. When browsing elements in Spy, select elements below the “WpfElement” window.
Insufficient privileges
Solution: Restart all Ranorex tools and the AUT with the same privileges, preferably as an administrator.
Active legacy UIA plugin
Using the legacy UIA plugin to identify WPF elements limits object recognition.
Solution: If you experience problems, switch to the native WPF plugin in Ranorex Studio under Settings > Plugins > WPF > WPF Legacy/UIA interaction > WpfImprovedOnly.
.NET Silverlight
Windowless property set to True
The Windowless property of your Silverlight AUT is set to True.
Solution: Set it to False and restart all Ranorex tools and the AUT.
Java
Insufficient privileges
Solution: Restart all Ranorex tools and the AUT with the same privileges, preferably as an administrator.
Delphi
Irretrievable remote object pointer
The started Ranorex tool(s) or the test executable couldn’t retrieve the remote object pointer for a particular item or classname. This is usually caused by an outdated Delphi version.
Solution: Check if you’re using a ⇢ supported Delphi version. If you are, please contact our support team for assistance.
Win32-based applications
There are various reasons why object recognition may be limited when working with Win32-based applications.
Insufficient privileges
Solution: Restart all Ranorex tools and the AUT with the same privileges, preferably as an administrator.
Bit bridge couldn’t be started
The started Ranorex tool(s) or the test executable and the automated process don’t have the same bit width and the 32/64 bit bridge couldn’t be started.
Solution: Please contact our support team for further assistance.
Bit bridge is disabled
The started Ranorex tool(s) or the test executable and the automated process don’t have the same bit width and the 32/64 bit bridge is disabled.
Solution: For full functionality, enable the 32/64 bit bridge in Ranorex Studio under Settings > Advanced > Enable 32/64 Bit Bridge.
Microsoft Internet Explorer
Slow automation
The Ranorex addon for Internet Explorer isn’t installed. This makes object recognition significantly slower.
Solution: Install the addon by running the Ranorex Studio setup again and only select the addon.
Image-based automation
Asynchronous dispatching disabled
The setting Asynchronous dispatching of mouse and keyboard events is disabled. In most cases, this will cause errors in image-based automation.
Solution: Enable the setting in Ranorex Studio under Settings > Advanced.
Geometry-related issues
Controls may be displaced, remain empty or scrolled out of view during automation.
Solution: Set the Use ensure visible property of the corresponding repository items (and their parent folders) to False as described in the chapter ⇢ Manage repository items.
Windows 8 UI apps
There are various reasons why object recognition for applications based on the Windows 8 UI may be limited.
Disabled setting “Use UiaLauncher…”
The setting Use UiaLauncher to elevate privileges for processes started by tools is disabled. This limits object recognition.
Solution: Enable the setting in Ranorex Studio under Settings > Advanced.
Ranorex Studio not installed in a secure location
Ranorex Studio is not installed in a secure location.
Solution: Install Ranorex Studio to Program Files or Program Files (x86).
Ranorex Studio not installed in a secure location
Ranorex Studio is not installed in a secure location.
Solution: Install Ranorex Studio to Program Files or Program Files (x86).
Test executable not started by a Ranorex tool
The test executable wasn’t started by a Ranorex tool.
Solution #1: Start the test suite from Ranorex Test Suite Runner.
Solution #2: Start the test executable with the Ranorex UiaLauncher (binRanorex.UiaLauncher32.exe) by passing the executable name as the first argument, e.g. Ranorex.UiaLauncher32.exebindebugMyTest.exe.
Solution #3: Add the following code to the Program.cs/Program.vb of the executable build of your test project:
if (Util.IsRestartRequiredForWinAppAccess)
return Util.RestartWithUiAccess();
“Run this program as an administrator” enabled
You enabled “Run this program as an administrator” in the compatibility settings of a Ranorex tool executable, e.g. for the RanorexStudio.exe file. Enabling this options prevents access to Windows 8 UI apps.
Solution:
Disable the setting for any Ranorex tool executables. If you want to run a tool with administrator rights, create a shortcut to the respective executable and enable the option in the shortcut properties under Shortcut > Advanced.
Mobile
There are various reasons why object recognition may be limited when working with WinForms.
Ranorex Service App not running
The Ranorex Service App isn’t running on the mobile device. This limits automation functionality, e.g. starting or stopping apps won’t be possible.
Solution: Make sure the ⇢ Service App is installed and running.
iTunes not running
iTunes couldn’t be detected. It’s required to connect to iOS devices via USB.
Solution: Make sure iTunes is ⇢ installed and started and then restart all Ranorex tools.
Trying to record in an emulator
You are using an emulator and trying to record a mobile test in it. Object recognition is limited in this case and Ranorex Studio reverts to image-based recording, i.e. UI elements will only be recognized by their coordinates. The test will not be robust against changes in the UI or even the window size of the emulator.
Solution: For full functionality, treat the emulator as if it was a real mobile device. Add it as an endpoint and build a mobile test as ⇢ explained here.
Miscellaneous
Anti-virus or security software
Antivirus or security software can sometimes affect object recognition.
Solution: Add an exception for the respective Ranorex process or temporarily switch off the specific security application.
RanoreXPath identifying multiple UI elements
A particular RanoreXPath identifies multiple elements when you only want it to identify one. This is because several instances of the same process are running, e.g. multiple instances of Mozilla Firefox.
Solution: If you will only have one instance running during the test, ignore this limitation. Otherwise, make the path more specific, so it resolves to only one UI element, even with multiple instances of the containing process running.
Different DPI scaling values
When testing with Ranorex Studio or one of its tools on a multi-display setup, different DPI scaling values can lead to object recognition issues .
Solution: Set the scaling of all connected displays to 100 %.
Failed EnsureVisible action
This warning occurs when Ranorex Studio tries to execute an action that has an EnsureVisible operator, i.e. requires that the targeted UI element is visible, but can’t bring the window that contains the UI element to the foreground. Usually, this is caused by insufficient privileges.
Solution: Restart Ranorex Studio as administrator or use the Ranorex.UiaLauncher to start your AUT.
If you start the AUT through Ranorex Studio, e.g. with a Run application action, activate Settings > Advanced > Use UiaLauncher to elevate privileges for processes started by tools.
If you start the AUT separately, you need to call Ranorex.UiaLauncher32.exe from the command line. It is located in the Bin folder of your Ranorex Studio installation folder, C:Program Files (x86)RanorexStudioBin by default.
The syntax for running an application through the UiaLauncher is:
Ranorex.UiaLauncher32.exe <path to application>