08 - Create API TestCases PDF
08 - Create API TestCases PDF
27
API
API
Exercise 8a – API TestCases
Objective
By the end of this exercise, you will be able to create an automated TestCase from an existing API Scan export.
Project perspective
Your task now is to test the products in the DemoWebShop, which were changed recently. The SKU of some products are now
different. You want to verify if the product BlueJeans still has the same SKU or ID. Since you cannot see the SKU of a product
on the UI of the DemoWebShop, you need to use an API TestCase. The web developers have provided you with the API Scan
data as a subset.
Instructions
1. In the TestCase section, create a new folder under the root folder and name it "API".
2. In the “API” folder, create a new folder and name it "8a API TestCase".
Hints
»» Make sure to use the correct ActionMode to verify the Response values.
28
Exercise 8b – Convert to Template, Link Values and Instantiate
Objective
By the end of this exercise, you will be able to create API TestCases, using Values from a TestSheet.
Project perspective
After creating the API TestCase to verify a product by its SKU, you will also need to link it to a TestSheet to be able to check the
SKU of, not only Blue Jeans, but other products as well.
Instructions
Duplicate the folder “8a API TestCase” and rename it “8b Convert to Template, Link Values and
1.
Instantiate”.
2. Convert the "Verify Product by SKU" TestCase to a Template.
Link the TestSheet "Verify Product by SKU" in the folder “8 API” in the TestCaseDesign section to the
3.
Template.
Link the Attributes from the TestSheet "Verify Product by SKU" to the TestStepValues, as the example
4.
shows below.
5. If there is any extra Value showing up next to the newly linked XL paths, delete the extra Values.
Hints
»» Before you drag and drop Values from the TestSheet to the Template, make sure to delete the existing Values in
the TestStepValues.
29