This article addresses specialized causes and solutions for limited object recognition across various development frameworks and environments.
.NET WinForms
Object recognition in WinForms often fails due to security restrictions or architectural mismatches.
- Insufficient privileges: Restart all Ranorex tools and the AUT with the same privileges, preferably as an administrator.
- Insufficient security rights: This can happen when you start the test executable and/or the AUT from a network drive or encrypted folder. Copy both the executable build and the AUT to a folder on the desktop of the machine you want to run the test on.
- Obfuscated controls: Ranorex cannot identify controls in mixed-mode (not DLL) or obfuscated executables. Automate a non-obfuscated version of the application.
- Target platform mismatch: Ranorex cannot identify controls implemented in an assembly that targets a particular platform/processor, while the test executable targets a different platform/processor. Change the Target CPU (in Ranorex Studio) or Platform Target (in Visual Studio) project settings to match the AUT. If you don’t know the target CPU/platform of the AUT, first try Any processor or Any CPU, respectively. If this doesn’t work, try the remaining options.
.NET WPF
WPF identification issues usually occur due to privilege mismatches or incorrect tree selection.
- Insufficient privileges: Ensure Ranorex Studio and the AUT run with the same privileges, preferably as an administrator.
- Active legacy UIA plugin: Using the legacy UIA plugin to identify WPF elements limits object recognition. If you experience problems, switch to the native WPF plugin in Ranorex Studio under Settings > Plugins > WPF > WPF Legacy/UIA interaction > WpfImprovedOnly. For more information, see Improved WPF Plugin.
- 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. If Ranorex Spy shows the UiAutomation capability, look at the Element tree. Select the preceding sibling (the item directly above) of that window. This sibling represents the same window but provides the native WpfElement capability, offering better stability and more attributes.
.NET Silverlight
- Windowless mode: Set the Windowless property of the Silverlight HTML object to False to allow Ranorex to detect internal elements and restart all Ranorex tools and the AUT.
Java
- Insufficient privileges: Restart all Ranorex tools and the AUT with the same privileges, preferably as an administrator.
- Instrumentation - Java Heap error: Ensure you are using a 64-bit version of Java. For more information, see Instrumentation Error – Java Heap Space.
Delphi
- Irretrievable remote object pointer: If you are using an outdated Delphi version, Ranorex tools, or the test executable may not be able to retrieve the remote object pointer for a particular item or classname. Confirm that the version you are using is supported. If it is, contact our support team for assistance. For more information, see Delphi Plugin .
Win32-based applications
There are various reasons why object recognition may be limited when working with Win32-based applications.
- Insufficient privileges: 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. Contact the 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. 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: Object recognition is significantly slower if you don’t install the Ranorex addon for Internet Explorer. Run the Ranorex Studio setup and only select the addon to install it.
Image-based automation
- Asynchronous dispatching disabled: Disabling the Asynchronous dispatching of mouse and keyboard events setting causes errors in image-based automation. Enable the setting in Ranorex Studio under Settings > Advanced.
Geometry-related issues
- Empty, displaced, or out of view controls during automation: Set the Use ensure visible property of the corresponding repository items (and their parent folders) to False. For more information, see 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.
- “Use UiaLaucher…” disabled: Enable the setting in Ranorex Studio under Settings > Advanced.
- Ranorex Studio installed in an insecure location: Install Ranorex Studio to Program Files or Program Files (x86).
-
Ranorex tool is not able to start text executable: Try any of the following solutions:
- Start the test suite from Ranorex Test Suite Runner.
- Start the test executable with the Ranorex UiaLauncher (binRanorex.UiaLauncher32.exe) by passing the executable name as the first argument, for example:
Ranorex.UiaLauncher32.exebindebugMyTest.exe. - 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: Enabling this option in the compatibility settings of a Ranorex tool executable, for example, for the RanorexStudio.exe file, prevents access to Windows 8 UI apps. Disable this 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 mobile applications.
- Ranorex Service App not running: If the service app is not running, starting and stopping apps is not possible. This limits automation functionality. Ensure the service app is installed and running. For more information, see Prepare Your Android Device.
- iTunes not running: iTunes is required to connect to iOS devices via USB. Make sure iTunes is installed and started and then restart all Ranorex tools. For more information, see Connect Your iOS Device.
- Record in an emulator: Object recognition is limited if you try to use an emulator and record a mobile test in it. In this case, Ranorex Studio reverts to image-based recording (UI elements are recognized by their coordinates). The test is not robust against UI changes or window resizing. For full functionality, treat the emulator as if it were a real mobile device. Add it as an endpoint and build a mobile test. For more information, see Run a Mobile Test.
Miscellaneous issues
- Anti-virus or security software affecting object recognition: Add an exception for the respective Ranorex process or temporarily switch off the specific security application.
- RanoreXPath identifying multiple UI elements: This can happen if several instances of the same process are running, for example, multiple instances of Mozilla Firefox. If you require multiple instances to run simultaneously, make the path more specific, so it resolves to only one UI element.
- Different DPI scaling values affecting object recognition: 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. The action 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.
- Restart Ranorex Studio as administrator and activate the Use UiaLauncher to elevate privileges for processes started by tools option in Settings > Advanced if you start the AUT with a Run application action, or
-
Use the Ranorex.UiaLauncher to start your AUT from the command line. Navigate to the Ranorex installation folder and run the following:
Ranorex.UiaLauncher32.exe <path to application>