Hello.
We are currently evaluating Ranorex to be used for the regression testing of our large Clarion application.
Is there some way in Ranorex to handle the changes on the ControlIds between f.ex. different versions of the AUT?
Our scenario is as follows: Currently, the ControlIds are automatically generated by Clarion templates. This seems to result a problem in running a test case on different versions of the AUT; if a form changes between the versions (ie. f.ex. a new control is added on the form), that changes the ControlIds on the form (in our case, the rest of the conrol ids (at least) on the form in question are incremented) --> the test case fails when run on a differet version of the AUT, than which version the test case was created from.
Is there a way to handle this kind of changes, either by the Ranorex Studio itself, or by coding f. ex. some kind of a conversion script for the ids, which would check the id differences?
Thanks a lot in advance,
Janne
Handling the changes on ControlId for regression testing
-
- Posts: 3
- Joined: Fri Apr 06, 2018 9:26 am
Handling the changes on ControlId for regression testing
You do not have the required permissions to view the files attached to this post.
Last edited by JanneSeppala on Fri Apr 06, 2018 12:45 pm, edited 1 time in total.
Re: Handling the changes on ControlId for regression testing
Are there any elements on the form which don't change and could be used as anchors?
Re: Handling the changes on ControlId for regression testing
Hi,
Could you please post an example of xpath with original and changed IDs? Ideally, post a Ranorex snapshot (NOT screenshot) of the problematic element (both created before and after change).
Generally speaking, there is no other way than to stop using dynamic ID's. I would suggest to check this blog post about automating apps with dynamic IDs:
https://www.ranorex.com/blog/automated- ... namic-ids/
Basically, you must instruct Ranroex to ignore dynamic IDs (while recording/tracking) and instead prioritize other attributes. If the IDs contains both unique string and randomly generated number/string (e.g. ListBox_123456), you may still be able to use these IDs using regular expressions. So for example instead of xpath like this:
Could you please post an example of xpath with original and changed IDs? Ideally, post a Ranorex snapshot (NOT screenshot) of the problematic element (both created before and after change).
Generally speaking, there is no other way than to stop using dynamic ID's. I would suggest to check this blog post about automating apps with dynamic IDs:
https://www.ranorex.com/blog/automated- ... namic-ids/
Basically, you must instruct Ranroex to ignore dynamic IDs (while recording/tracking) and instead prioritize other attributes. If the IDs contains both unique string and randomly generated number/string (e.g. ListBox_123456), you may still be able to use these IDs using regular expressions. So for example instead of xpath like this:
You can use this:.//div[#'ListBox_123456']//div
But this approach may make your xpaths non-unique and therefore, you may need to add some additional attributes for unique element identification..//div[@id~'ListBox']//div
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
-
- Posts: 3
- Joined: Fri Apr 06, 2018 9:26 am
Re: Handling the changes on ControlId for regression testing
Hello!
Snapshots added to the first post (Note: just a very small part of the application, similar problems in many places with various different controls).
in this example, we have an added button control in the new version.
Snapshots added to the first post (Note: just a very small part of the application, similar problems in many places with various different controls).
in this example, we have an added button control in the new version.
Re: Handling the changes on ControlId for regression testing
Yes, it's exactly what I thought. Well, I have a very bad news for you. Clarion apps are pretty bad for automation, no matter which test automation tool you will use. We too have an app developed with Clarion and few months back I did POC test with Ranorex. Unfortunately, the app turned out to be pretty unautomatable via GUI. The only (partial) success was using GDI Capture List (as described here).
Clarion control IDs are useless and the only other usable info seems to be a part of Class attribute. But even with Class attribute, you will have to use regexes and they will not help much with unique element identification. Which means you can forget about simple Record&Replay without heavy manual editing of each recorded xpath. Additionally, in some cases, you may be completely unlucky to extract texts from certain Clarion controls (even RAW texts, using GDI Capture List).
All in all, it's possible to automate Clarion apps with Ranorex, but you should be prepared for heavy editing of everything you record. And because you will have to use a lot of manually added control indexes in the xpaths, you should be prepared for the need to update them from time to time, if the GUI changes significantly.
Here is an example xpath, which may help you to identify edit control (containing text 'Viljanen'), using label "Sukunimi:"...
Clarion control IDs are useless and the only other usable info seems to be a part of Class attribute. But even with Class attribute, you will have to use regexes and they will not help much with unique element identification. Which means you can forget about simple Record&Replay without heavy manual editing of each recorded xpath. Additionally, in some cases, you may be completely unlucky to extract texts from certain Clarion controls (even RAW texts, using GDI Capture List).
All in all, it's possible to automate Clarion apps with Ranorex, but you should be prepared for heavy editing of everything you record. And because you will have to use a lot of manually added control indexes in the xpaths, you should be prepared for the need to update them from time to time, if the GUI changes significantly.
Here is an example xpath, which may help you to identify edit control (containing text 'Viljanen'), using label "Sukunimi:"...
/form[@title~'^Perustiedot\ -\ Käyttäjä:SY']/?/?/form[@title='Käyttäjätiedot']//element/text[@accessiblename='Sukunimi:']/parent::element/following-sibling::element[@class~'ClaEdit'][1]
Last edited by odklizec on Fri Apr 06, 2018 1:30 pm, edited 1 time in total.
-
- Posts: 3
- Joined: Fri Apr 06, 2018 9:26 am
Re: Handling the changes on ControlId for regression testing
Hi,
ok, thank you very much for your help on this. We will continue discussion about wether or not proceeding with the pilot from now on.
- Janne
ok, thank you very much for your help on this. We will continue discussion about wether or not proceeding with the pilot from now on.
- Janne
Re: Handling the changes on ControlId for regression testing
You are welcome. I've added a small xpath example in previous post, showing the approach you will have to use with Clarion elements. But as mentioned, it may not work in all cases and you may be unlucky to extract texts from some controls at all.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration