Running the same test case in different versions of SUT

Ask general questions here.
rj-nora
Posts: 38
Joined: Thu Mar 11, 2010 3:56 pm

Running the same test case in different versions of SUT

Post by rj-nora » Fri Apr 30, 2010 5:39 pm

Hello
i verified that a specific automated test case didn't play in diferents versions of the same application under test, because Ranorex recognizes the application under test form and store it on the repository by its name. for example my app under test path is : /form[@controlname='APP'] but when i need to perform one validation Ranorex do this (generated code):
public static void Validate_ComboBoxComboBoxFacility1(){
Report.Info("Validating AttributeEqual (SelectedItemText='1702') on item 'FormAPP_4_2_0_0.TabPageListTabControlSelection.ComboBoxComboBoxFacility'.");
Validate.Attribute(repo.FormAPP_4_2_0_0.TabPageListTabControlSelection.ComboBoxComboBoxFacilityInfo, "SelectedItemText", "1702");}
The problem is that Ranorex make its validations calling the name FormAPP_4_2_0_0 stored on Ranorex Repository, but when a new release comes out that form changes the name .i.e to FormApp_4_2_0_1 and the same Test Case won't recognize the controls. My question is : i can specify a way to Ranorex store a certain application, and call it not for its full name but for example by its directory?Can you show me how to do that by code snippets?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Running the same test case in different versions of SUT

Post by Support Team » Mon May 03, 2010 1:08 pm

Hi!

Of course it's possible. You only have to find a valid RxPath which is available for all versions of your application. Please take a look on these two screen casts "RanoreXPath" Part One and "RanoreXPath Part Two" on our webpage. (http://www.ranorex.com/support/screencasts.html) In these two videos will be explained, the best way to use RxPath.

Regards,
Peter
Ranorex Support Team

rj-nora
Posts: 38
Joined: Thu Mar 11, 2010 3:56 pm

Re: Running the same test case in different versions of SUT

Post by rj-nora » Mon May 03, 2010 4:22 pm

The problem is that for example, when i want to click or validate a certain RadioButton in one version a i have the path container[@controlname='groupBoxAPP']/radiobutton[@controlname='radioButtonMoveIn'] and on the other : container/container[@controlname='_groupBoxAPP']/radiobutton[@controlname='_radioButtonMoveIn']

Which are the better way to tunr that path Generic, and make the same test recognize both controls?
In that specific case of make Ranorex validate radioButtonMoveIn above how can i automate the test?What i have to do? How can i provide Ranorex to find for example the radioButtonMoveIn by its name?Which are the better way to make this?

Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Running the same test case in different versions of SUT

Post by Support Team » Mon May 03, 2010 4:47 pm

Hi!

There are two ways you could solve this problem.
1. Use regular expression for RxPath. http://www.ranorex.com/support/user-gui ... html#c2463
container[@controlname~'groupBoxAPP']/radiobutton[@controlname~'radioButtonMoveIn']
but this won't work if the elements not in the same context (level of RxPath)

2. Search for other attributes which identify the elements you want to automate.
container[@controltext='groupBoxAPP']/radiobutton[@controltext='radioButtonMoveIn']
Regards,
Peter
Ranorex Support Team

rj-nora
Posts: 38
Joined: Thu Mar 11, 2010 3:56 pm

Re: Running the same test case in different versions of SUT

Post by rj-nora » Mon May 03, 2010 5:06 pm

Hi again Peter,

i didn't get your idea with the second option, can you be more specific? I get the idea of find the radion button or other control, how can i use
container[@controltext='groupBoxAPP']/radiobutton[@controltext='radioButtonMoveIn'] in the context of click in that button or validate it? like do repo.FormTact_Chart.RadioButtonMove_In.Click("6;9") or Validate.Attribute(repo.FormTact_Chart.RadioButtonMove_InInfo, "Checked", "True"); 

One mor question i have to make it for every single action i record and want to validate or click on right?

Thanks a lot

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Running the same test case in different versions of SUT

Post by Support Team » Tue May 04, 2010 1:00 pm

Hi!
rj-nora wrote:i didn't get your idea with the second option, can you be more specific?
As I said try to find another attribute* to identify the button in order to create a "new" RxPath which works with both of your applications. Please take a look on following Screencast http://www.ranorex.com/support/screencasts.html for better understanding RxPath.

*Using different attributes of an element in RxPath means that you can identify an element/control/.... in different ways.
For example a button can be found by
button[@text='My Button']
button[@accessiblename='myButtonAccessible']
button[@controlname='myButtonControlName']

These three ways to identify the button can produce the same result, i.e. Ranorex always accesses the same button on your User Interface.

rj-nora wrote:One mor question i have to make it for every single action i record and want to validate or click on right?
You can change the path in your Repository. Just enable highlight element and search for the element you want. If you are on the right place please click in the "Text Box Path" or click the element and hit "Enter on your Keyboard" to edit the path of the value. Ranorex recognizes that something changed in the repository and will update all parts in your project where this element is used.

Regards,
Peter
Ranorex Support Team

atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Re: Running the same test case in different versions of SUT

Post by atom » Tue May 04, 2010 5:53 pm

I would suggest not to try to attempt to write a test that works in ALL versions of your AUT
But instead use source code control, and have a version of the test that corresponds to the version of the AUT
If your Dev team are using source control, you can use the same for your test code