Unable to use most functions with the RanorexDriver

Ranorex Studio, Spy, Recorder, and Driver.
Posts: 3
Joined: Tue Feb 21, 2023 3:13 pm

Unable to use most functions with the RanorexDriver

Post by leharn01 » Wed May 10, 2023 3:31 pm

Hello everybody,

I previously posted this issue in the "Ranorex Driver" section of the forum, but unfortunately, I have not received any response for almost two months.

In our company, we rely on the RanorexDriver with Python to script our test cases. We have always used a pre-release version of 9.3.2. However, the digital certificate for version 9.3.2 expired around winter last year. Recently, we attempted to update to the latest version (10.2.2), but we encountered several strange bugs in this version that severely affect the driver's functionality.

Firstly, we tried resolving these issues with both a fresh installation of Selenium 3.14 and Selenium 4, but the errors persisted in both situations. We also experimented with various versions of Python from 3.7 onwards and tested all available RanorexDriver versions (including the corresponding Studio Versions, with the latest Studio version tested being 10.6.1). The only version that works properly is 9.3.2.

The most critical problem occurs when a Selenium exception is raised, such as a "NoSuchElementException." The RanorexDriver returns a response with incorrect formatting, causing the Selenium ErrorHandler to fail in decoding the response. As a result, instead of the expected error, a KeyError is raised:

Code: Select all

File "C:?\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
File "C:?\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 130, in check_response
status = value["status"]
KeyError: 'status'
The Ranorex Driver response includes an additional JSON key called 'sessionId,' which causes an issue because Selenium expects only one key, namely 'value.' To resolve this problem, you can modify the Selenium error_handler() by removing the 'sessionId' key from the error response.
Unfortunately, after we found the solution to the problem, we discovered multiple additional bugs.

If you already created a WebElement, you cannot use the .find_elements or .find_elements_by_xpath method on the Webelement. The RanorexDriver flat out responds that it doesn't know which method to use in that case. Interestingly, if you use the singular versions, such as .find_element() or .find_element_by_xpath, on an already created WebElement, it works correctly.

The second bug is that you can't use .get_attribute() on any created WebElement because scripting is disabled.

Lastly the Ranorex Driver does not recognize any of the special keys provided by Selenium in "from selenium.webdriver.common.keys import Keys". It does not matter if it's "Enter" or any other modifier or function key. Instead of performing the specified keypress, the driver sends the key as a string.

All of these functionalities worked perfectly fine in version 9.3.2.

Has anyone received more information on this topic? It would be reassuring to hear from the Ranorex Team. We are already in discussions with the support team, but we have not received any concrete information regarding these issues. As it stands, the RanorexDriver is completely unusable with any of the officially released versions.

Posts: 4
Joined: Fri Mar 27, 2015 3:48 am

Re: Unable to use most functions with the RanorexDriver

Post by lac » Mon Sep 11, 2023 5:04 am

I have exactly the same issue - I have not heard anything back from Ranorex either. There is an issue before this though I have found - when using RanorexDriver, files seem to be missing, such as isDisplayed.js and getAttribute.js. Once I actually add these into my (C#) solution (from Selenium source code on GitHub) and try to use either, I get the "scripting not supported" issue. Can anyone assist with this?!?!

This bug renders RanorexDriver useless....