02 - Templates
02 - Templates
02 - Templates
Project perspective
The DemoWebShop, like most other online web stores, requires the user to log in before they can purchase goods from the
store. You need to create a TestCase that automates the login process in order to avoid doing it manually each time.
Instructions
1. Navigate to the TestCases root folder and add the Test Configuration Parameters “Email” and “Password”.
Enter the first pair of Email and Password created in lesson 1 as values for the Test Configuration Parameters
2.
created above.
3. Add the Test Configuration Parameter “Browser” with the value "InternetExplorer".
Within the root folder “TestCases”, create a new folder called Template. In there, create a subfolder called
4.
"2a Log In Process".
5. In the subfolder "2a Log In Process", create a new TestCase called "Log In Process".
Add the Reusable TestStepBlocks "Precondition" and "Postcondition" from the Library to the TestCase "Log
6.
In Process".
Hints
»» To recap the creation of Test Configuration Parameters, please see Lesson 2 of Automation Specialist Level 1.
»» TestSteps and Reusable TestStepBlocks can easily be searched and added to a TestCase by using the “Add
TestStep” function (CTRL+T).
8
Exercise 2b - Resolve Reference
Objective
By the end of the exercise, you will be able to use the Resolve Reference command to break the connection between the
Reusable TestStepBlock and the TestCase.
Project perspective
If we want to use the Email and Password data from the TestSheet in the TestCase, we must be able to link them to the Email
and Password TestStepValues. Right now, the Log in TestStep belongs to the Reusable TestStepBlock Precondition. You need
to Resolve the Reference to edit the TestStep.
Key elements:
Reusable
TestStepBlock
Instructions
1. Duplicate the TestCase folder "2a Log In Process" and rename it to "2b Resolve References".
Right click on the Reusable TestStepBlock Reference “Precondition_Reference” and choose “Resolve
2.
Reference”.
Create a new folder in the TestCase “Log In Process” and name it “Workflow”. Place the folder in between
3.
Precondition and Postcondition_Reference.
4. Move the TestStep Log In from the Precondition folder to the Workflow folder.
5. Enter the following Values for the TestStepValues as per the table below:
Hints
»» Once a reference is resolved, it is not possible to revert the action. You can use the undo arrow on the top left of
Tosca. However, this option is only available if you have not saved the project after resolving the references.
9
Templates
Project perspective
The login process of the DemoWebShop needs to be tested multiple times with many different accounts. It is time-consuming
to duplicate one TestCase multiple times and then edit the values manually. It is also hard to maintain the TestCases when
something is changed. Instead, you can create a Template from your Log in Process TestCase and link the data from the
TestSheet to it.
Instructions
1. Duplicate the folder "2b Resolve References" and rename it to "2c Convert to Template".
2. Right click on the TestCase "Log In Process" and select “Convert to Template”.
10