Let us assume a scenario that we need to automate test of a complex functionality. This complex function may be constituted of other small functions. Now all small functions are tested separately. To automate test of this bigger function we have two choices
- Record all steps in bigger function testing
- Use various smaller functional tests as a step in bigger function testing.
Test Studio provides us a feature in which we can use a functional test as step of another functional test. You can get that option in Add section of ribbon.
Assume we need to test CRM application. We have separately created automated test for Login functionality of application as given below,
And steps of this test is recorded as following
Next we want to record test for bigger function Add Contact in CRM. To do that let us create a test as following,
Now we want to use Login Test as a step in Add Contact test. To do this double click on Add Contact test to open the test. After that from Add section in ribbon select Test as Step option.
You will get option to choose from all the tests added in the test project. In this case there is only one test other than Add Contact Test. So select Login Test to add as step in Add Contact test.
After adding Login Test as step right click on the test and from context menu select Run then To here option.
On selecting this option Test Studio will first execute all the steps of Login Test and allow you to record further steps for Add Contact test.
In this way we can add a test as step in Test Studio to use a functional test as part of another bigger functional test. I hope you find this post useful. Thanks for reading.