TestProject – Looping certain set of steps (without the help of addons)

Though we can loop a certain set of steps with the help of addons, lets see how we can do the same with the help of TestProject features.

Scenario:

  • Open https://example.testproject.io/web/
  • Fill up Full Name, Password and click on Login button
  • Fill up Country, Address, Email, Phone
  • Now think of a scenario where you want to repeat step# 3 for 2 or 3 times based on the requirement. We can do it easily with the help of Addon but our intention is to that with the help of TestProject inbuilt features.

What do we need?

Create a test case as application set up which will open the browser, load the url, and fill up Full Name, Password and click on Log in button. Name it as : TC_LOOP_TestCaseOne

Now create another test case just to fill up the fields Country, Address, Email and Phone.

Parametrize the fields Country, Address, Email and Phone and create a csv file and will use that one as a datasource (csv file). Lets name it as ‘TC_LOOP_TestCase_Nested‘.

  • Create a job
  • Add the TC_LOOP_TestCaseOne as first test case and
  • TC_LOOP_TestCase_Nested as second test case and
  • associate the TC_LOOP_TestCase_Nested with data source csv file that we have created previously.

Content of the CSV file

Country,Email,MyAddress,Phoneno
DZ,gmail@g.com,MY Kesura,8822223131
DZ,gmail@YAHOO.com,MY Kesura Saheed no,84792374893288

Edit the job and make sure that ‘Restart the browser before each test’ should be unchecked.


Once the test case is run, then you will see TC_LOOP_TestCase_Nested is repeated based on the no of records in the csv file. 

About This Site

The main aim of this site is to share knowledge with fellow software test specialists who are keen to grow both technically and professionally.

Categories