Looping/Iterating a test suite (not a test case)

Ask general questions here.
karun
Posts: 2
Joined: Thu Jan 12, 2017 3:52 am

Looping/Iterating a test suite (not a test case)

Post by karun » Thu Jan 12, 2017 4:05 am

I have the following use case for a web app:

1) A test suite comprising of 10 test cases
2) TC 1 - Open Browser, TC 2 - login, TC 3 - Search for a product, TC 4 - Add product to card, TC 5 Check out, ... TC 10 Close browser.

I need to able to do the whole cycle (test suite) on 3 different browsers (IE, Firefox, and Chrome). I am able to iterate a single test case only by have three rows of test data. However, this would not help as this would only Open IE first and open Firefox and then open Chrome.

What I would like to do is open IE and run the rest of the test case, close IE and then on the second iteration, open Firefox and run the rest of the test case and do the same on Chrome. This way I would be able to complete my testing on all three browsers without manually having to change the browser type after each iteration.

Thanks for the help!

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Looping/Iterating a test suite (not a test case)

Post by odklizec » Thu Jan 12, 2017 2:36 pm

Hi,

The easiest way to achieve what you want is to enclose all 10 TCs in one "master" TC with data connector, containing IE, FF and Chrome iterations. This "master" TC will then loop all your TCs in each specified browser.

So the whole structure of your solution should look like this:

Code: Select all

TC0 (data connector with Browsers here)
  |_TC1
  |_TC2
   ...
  |_TC10
Hope this helps?
Pavel Kudrys
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

sergii
Posts: 30
Joined: Fri Jun 07, 2013 11:07 pm

Re: Looping/Iterating a test suite (not a test case)

Post by sergii » Fri Jan 13, 2017 7:10 am

Previous answer is correct. It's not obvious initially but you can have Test Cases inside other test cases.

I would add that it's recommended to join test scripts into the test cases that actually do a real tests for you.
In your example TC 1 is Open browser.
What if this test pass or fail, did you find any bugs in your solution that you are developing? It sounds like you need to have something like this:

Test Suite:
TC 0 "SetParameters"
..script: read Browser, user credentials, etc from datasource
..TC 1 "OpenBrowser_Login_EnsureHomePageLoaded":
.... script 1: Open browser
.... script 2: Login to your webpage
.... script 3:
..TC 2 "Read product details"
and so on


Try to differentiate technical steps from real testing ;)

karun
Posts: 2
Joined: Thu Jan 12, 2017 3:52 am

Re: Looping/Iterating a test suite (not a test case)

Post by karun » Fri Jan 13, 2017 5:10 pm

With your suggested configuration, I was able to successfully achieve what I was looking for.

I appreciate the help guys. Thanks.