TestProject – Call one Test Cases from another test case

There might be a scenario where you may want to repeat the same set of steps in different test cases e.g.

  • loading the main url (think of scenario @BeforeTest or @BeforeClass in TestNG).
  • load the main url, click Accept button on the GDPR pop up.
  • User registration

How to proceed?

Lets create a simple test case which will load the url and close the GDPR pop up or Cookie accept message etc.

Attached screenshot for reference

  • Screenshot of Test case : ApplicationSetUp – 1

Screenshot of Test case: ApplicationSetUp – 2

Now the target test case where we will implement the above ApplicationSetUp test case

  • Create a new test case called SearchTest with the steps mentioned in the screenshot
  • Lets replace the first 2 steps with ApplicationSetUp Test case
  • Open the SearchTest test case and click on + button to add the ApplicationSetUp
  • From Create Step overlay, for Type, select Test radio button and click on Tick mark on the bottom

From Test, select ApplicationSetUp test case and proceed. In case your ApplicationSetUp test case is parameterised, system will ask to select Yes or No. Select Yes

Check the details and click on Create

  • The step added will be last step
  • Click on tick mark (Multiple select) and select the first 2 steps and click on Delete Steps

Move the ApplicationSetUp steps to the top to make it step no 1 and click on Save & Exit on top right corner

All set

This is how we can add a selected set of test cases to the new Test cases.

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