TestProject Forum
Powered by leading experts in the test automation community

Looping Nested Test case

I would like to know if we can loop a nested test case and also associate that with a data source?
I can do that with the addon but i wanted to know if its doable in testproject UI.

e.g. Registration Test case

  1. Set up the browser
    2. Register for a new user
    3. Enter name, password etc
    4. Log out
  2. Close the browser

I would to have steps 2 to 4 as a separate test case and associate that with a data source and loop it based on the no of records in the data source. So when I run the test case : Registration Test case, it should create a certain no of users based on the entries in csv file.I dont want step 1 and 5 to be repeated.

Hope I am clear with my question.
Please help

Hi, it can be done easily with data driven test, no nested tests or addons required follow those steps:

  1. Create a login test , with user and password values as parameters
    image

  2. save the test, locate it in a folder and press on “Data source Template”

  3. add the desired set of values (URL, User, Password) , each row in the CSV file will be an iteration you can add unlimited set of values

  4. save the CSV file and upload it as a data source

  1. go to the Tests & Jobs and create a new job

  2. drop your login test to a job

  3. attach the data source to a login test

  1. run the job!
1 Like

Hi Thanks for the reply. My intention was / is to run the nested test case in loop with the help of data source.
I dont want to repeat the browser invocation and closure during execution. Both invocation and closure should be done only once.

e.g. If TestCase2 is embeded in TestCase1 as a test/step, then TestCase2 steps should be executed based on the datasource.
I hope I am clear now. Thanks for the help

got it! to avoid browser invocation and closure during execution just make sure that this toggle switch to off. in that case the next test will run from the point the last test ended… and this exactly how you can achieve that only this test will run multiple times… just exclude it from the nested test put it separately in the job.

1 Like

Hi, Thanks I got it now. Able to loop the second test case without (its not nested) invoking the browser twice.

Looping2ndTest

Thanks again!

This is great! :slight_smile:

1 Like