How to Use a Smaller Test as Step of Bigger Test in Test Studio

Let us assume a scenario requiring an automated test of complex functionality. This complex functionality might consist of smaller functions. Now all small functions are tested separately. To automate the test of the larger function we have two choices:

  1. Record all steps of the larger function's testing
  2. Use various smaller functional tests as a step in the larger function testing.

Test Studio provides us a feature in which we can use a functional test as a step of another functional test. You can get that option in the Add section of the ribbon.

Add-section-of-ribbon.jpg

Assume we need to test a CRM application. We have separately created an automated test for Login functionality of the application as in the following:

test-CRM-application.jpg

And the steps of this test are recorded as in the following:

steps-of-this-test-is-recorded.jpg

Next we want to record a test for a larger function using "Add Contact in CRM". To do that let us create a test as in the following:

bigger-function-Add-Contact-in-CRM.jpg

Now we want to use "Login Test" as a step in the "Add Contact" test. To do this double-click on the "Add Contact" test to open the test. After that from the Add section in the ribbon select the "Test as Step" option.

Add-section-in-ribbon-select-Test.jpg

You will get an option to choose from all the tests added to the test project. In this case there is only one test other than Add Contact Test. So select "Login Test" to add a step in the "Add Contact" test.

steps-of-this-test-is-recorded.jpg

After adding "Login Test" as a step right-click on the test and from the context menu select "Run" then the "To here" option.

After-adding-Login-test.jpg

On selecting this option Test Studio will first execute all the steps of the Login Test and allow you to record further steps for the Add Contact test.

In this way we can add a test as a step in Test Studio to use a functional test as part of another bigger functional test. I hope you find this article useful. Thanks for reading.
 

Up Next
    Ebook Download
    View all
    Learn
    View all