Creating a Ranorex snapshot
A Ranorex Snapshot is a file representation of the user interface (UI) structure of an application under test (AUT) at a particular point in time. A Ranorex Snapshot captures all interface elements, their hierarchy, values, etc.
It can be saved as a single file. A Ranorex Snapshot file can be created and viewed with Ranorex Spy. The file extension is .rxsnp.
Typically, Ranorex Snapshots are used to share detailed information about the UI of an application with the Ranorex support and technical sales team.
You may also want to have a look at the available screencasts on this important topic.
Creating a compressed Ranorex solution
A compressed Ranorex solution is a file archive including all relevant files of a solution. This solution is created by a built-in compression function which works similarly to any other compression software.
Create a compressed Ranorex solution
Creating a compressed solution is simple – follow the below instructions.
-
Loaded a solution, open the Tools menu
-
Click Compress solution and open folder
Result(s)
The compressed file will be created in the solution folder.
-
Project file folder before the creation of a compressed Ranorex solution
-
Project file folder with the compressed Ranorex solution (
Introduction.zip
)
Creating a compressed Ranorex report
A compressed Ranorex Report is one zipped file including all files that belong to a single report. These are the report file itself (*.rxlog
), all images and further relevant files. The file extension is ‘.rxzlog
‘.
Automatically create compressed Ranorex report
Ranorex can be configured to create a compressed copy of every report that is created. This is done in the report settings of the settings & configuration area. Here is what to do.
Accessing the report settings
-
Select the test suite and open the context menu
-
Click Properties in the context menu
-
In the settings window, click the Report Register tab
Enabling compressed report copy
Check the corresponding checkbox in the settings dialog to enable the automatic creation of a compressed report copy.
Result(s)
The compressed Ranorex report file is saved in the output folder of the project file structure.
-
Destination folder
The output folder of the solution isbinDebug
In this folder, the compressed report copy is saved to -
Compressed report copy
See the compressed report copy with the file ending '.rxzlog
'
The naming conventions are the same as for regular reports
Manually create a compressed Ranorex report
Any created report can be saved as a compressed Ranorex report. This is how to do it.
-
Open the context menu in a created report in Ranorex Studio and click Save as…
-
Select a destination folder, optionally change the file name, and click Save
Important to consider:
-
See the default destination folder which is the current root solution folder
-
See the default file name for the compressed report and the according file type
.rxzlog
-
Click OK in the information window confirming the creation of the compressed report
Result(s)
-
See the compressed report file in the designated destination folder
Fix the ‘element not found’ error
The “element not found” error (i.e. ENF) is one of the most frequent errors that can cause a test to fail. Unfortunately, it’s often not easy to find out what caused the error, especially if you’re not that experienced in Ranorex Studio yet.
This is where this guide comes in. It will help you identify the most common causes of the error and resolve them so your test will execute successfully.
Analyze report
When you encounter the ENF error, report analysis is the first thing to do.
-
See the report identifying a test failure
-
ENF error stating that a UI element could not be found
Screenshot inspection
The report provides several screenshots to make it easier for you to identify what went wrong. These screenshots show what happened in the last seconds up to the error.
Compare the screenshots and pay special attention to the UI element you wanted to find. Select the corresponding to your analysis:
- Proceed to Step 1 if the UI element is NOT in the screenshot
- Proceed to Step 2 if the UI element is IN the screenshot
Step 1 – UI-element is not in screenshot
Solution approach
Make sure the application under test is in the correct state.
Summary
If the UI element isn’t there, it means that your application under test (AUT) wasn’t in the correct state for the UI element to be found within the search timeout. This can have various causes. For example, a button might not appear until a certain action is completed and this action is taking longer because the system is working slower than usual. This will cause the UI-element to be there during some runs, and not during others.
Solution
Ensure the application under test always reaches the correct state for Ranorex Studio to find the UI element:
- Check that all the actions needed to reach this state are there. For example, if a UI element is only reachable through a context menu, make sure there is an action that opens this context menu beforehand.
- Add validations to verify that the window, page, etc. that contains the UI element appears during test execution.
- Increase the search timeout on the repository item or add a WaitFor action in the action table to compensate for slowdowns of the application under test and other possible delays.
Step 2 – UI element is in the screenshot
Solution approach
Check the RanoreXPath specification of the UI element.
Summary
If the UI element is in the screenshot, it means that your application under test reached the correct state for the UI element to be found within the timeout. However, Ranorex Studio still couldn’t find the UI element, so something else must be wrong. The most likely explanation is a faulty RanoreXPath. This can have various reasons, such as changes to the GUI, dynamic parts, multilingual GUIs, or even simple typos.
Open the UI element in Spy
To be able to check and edit the validity of the RanoreXPath specification it is necessary to open the UI-element in Spy.
-
Ensure the application under test is in the same state when the ENF error occurred
-
Select the repository item and click EDIT IN SPY to open it in Ranorex Spy
Identify faulty RanoreXPath elements
First of all, the highest faulty level in the UI-element tree browser needs to be identified for more detailed error analysis.
-
Identify the highest faulty tree level
Check for RanoreXPath syntax
Check the predicate of faulty RanoreXPath specification for possible errors:
- Check attributes, values, and operators
- Look for typos, incomplete specifications, and wrong values
Check variables
- Does the RanoreXPath specification contain variables?
- Check if variables are correct and if they are bound to data sources
- Check if the referenced values are correct
Re-track UI-element(s)
Perhaps the attributes and variables are correct, but the path structure itself is faulty, resulting in the UI element not being found. A good way to solve this problem is by re-tracking the UI element.
Contact Ranorex support team
If you tried everything to solve the problem, but it remains – your challenge seems more complex. Therefore, make a snapshot of your solution and contact the Ranorex support team using the contact form at /support-query/
.