Using variables for Browsers and URLS

Ask general questions here.
martinsw
Posts: 72
Joined: Fri Dec 09, 2011 2:48 pm

Using variables for Browsers and URLS

Post by martinsw » Mon Jan 30, 2012 11:32 am

Hi,

I'm trying to create a test solution to run using the 4 supported browsers (IE, firefox, chrome, safari) on multiple environments where each environment has its own URL.

What I want is for the test solution to iterate through all combinations of browser + environment when the test runs. See below:

IE -----------> env1 -----> test
firefox -----> env1 -----> test
chrome -----> env1 -----> test
safari -------> env1 -----> test

IE -----------> env2 -----> test
firefox -----> env2 -----> test
chrome -----> env2 -----> test
safari -------> env2 -----> test
etc....etc...

The evironment and browser will be data driven from an external excel file.The same test will then run on each combination of browser and envronment.

Can you recommend the most efficient way of doing this please? One soluition is for me to list all the different combinations of environment + browser in my excel spreadsheet but this seems a bit inefficient. It means that if I want to perform the same tests on an additional environment, i'll have to add 4 new rows into the data source and manually specifiy the combination of environment + browser for each.

If it's possible, i'd just like to list the environments and the browsers in different columns in my excel spreadsheet and then have the test automatically iterate through the different combinations without me having to manually state them. That way, should I need to add a new environment for testing, it will just involve me adding that environment to the "environments" column within the spreadsheet. Ranorex will then automatically include 4 new iterations for the new environment when the test is run.

One idea I had was to specifiy the environment variable in a parent test case then specify the browser variable in a child test case. However, I'm not sure that it's possible to do this given that you need to state both the URL and the browser when using the "open browser" action. Finally, I would then specify the tests to be performed in the grandchild test case. Can please assist and provide some guidance on how I should going about doing this? Please note I am a tester and not a developer so I would need to know how to achieve this using the Ranorex tools rather than manipulating code directly.

Many thanks,

Martin

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

Re: Using variables for Browsers and URLS

Post by Support Team » Mon Jan 30, 2012 12:48 pm

Hi,
One idea I had was to specifiy the environment variable in a parent test case then specify the browser variable in a child test case. ...
I think this would be the best solution.
You can use one excel file twice, one column for the environment variable for test case one and the second browser column for the "child" test case.
You can select the region for the data source within the data manager, so you can select the first column like this "A1:A5" for instance.
You have to consider that you would need two module variables, because you have to bind them in the "child" test case to the appropriate columns.
This will allow you iterating trough the combination of the columns of your single Excel file.

Regards,
Markus
Ranorex Support Team