TDS2 Exercise 03 v1.0
TDS2 Exercise 03 v1.0
Business Context
In this exercise, we will look for a customer with the Status “New“.
Once we retrieve a test record, it becomes automatically locked, meaning that no other tester can use this test record in their
TestCase. This ensures consistency and accuracy with the state of the data when working in a distributed environment. Once
you have executed your test, the record become automatically unlocked.
Instructions
Find TDS record Expand the Data search filter and enter the Values for the Set the correct Action Mode
TDS Attributes as below:
Status Enter the correct Value Set the correct Action Mode
Navigate to the TestStepFolder “Login with New Customer in Web Shop“ and jump to the TestStep “Login
4.
Page“. Enter the data as per the table below:
6. Update the WorkState of the TestCase to COMPLETED and save your changes.
7. Refresh the Test Data Management page in the web browser to view the changes in the TDS repository.
Hints
»» The {TD[…. ]} function is a command used to retrieve a specific record from the TDS repository. The syntax is similar
to the syntax used to retrieve variables from the Buffer. The Value in the square brackets relates to the record you
wish to retrieve. In this case, it is the Value stored under the TDS type “CustomerDetails“ with the Value “Email“.
15
RETRIEVING AND UPDATING TEST RECORDS THROUGH TDS
Business Context
In the DemoWebShop, a customer becomes “Active“ once they have added an address. These changes are reflected in the TDS
repository, with the Status of that customer changing from "New" to "Active".
Instructions
1. Navigate to the TestCase “Update customer address record“ in the Folder “Exercise 3B“.
Copy and paste the TestStep from the TestStepFolder “Find for New Customer in TDS records“ in
2.
"Exercise 3A" into the TestStepFolder "Find for New Customer in TDS records" in Exercise 3B.
In the TestStepFolder “Add an Address“, navigate to the TestStep “Addresses | New address“ and retrieve
3. the test records for “FirstName“ and “LastName“ from the TDS repository to enter those customer details in
the DemoWebShop application, as per below:
Addresses | New FirstName Enter the correct Value using the {TD[…. ]} function Set the correct Action Mode
address LastName Enter the correct Value using the {TD[…. ]} function Set the correct Action Mode
Add the TDS Standard Module "TestData - Update Record“ to the TestStepFolder “Update TDS record with
Active Status“ and rename the TestStep to "Update TDS record“.
4.
Enter the appropriate Values for the TestStepValues Existing alias name (record)* and Status to update
the customer details to "Active" once they have added an address.
5. Run the TestCase in the Scratchbook.
6. Update the WorkState of the TestCase to COMPLETED and save your changes.
7. Refresh the Test Data Management page in the web browser to view the changes in the TDS repository.
Hints
»» Updating any TDS records in your database does not work solely with using the TDS Standard Module "TestData
- Update Record“. First, you must find and retrieve the record with the help of the TDS Standard Module "TestData -
Find & provide record“, and then perform an update on it.
16
Exercise 03C | Add Items to the Shopping Cart
Objective
By the end of this exercise, you will be able to add items to the shopping cart in the DemoWebShop application and
simultaneously update the Item’s record for the relevant Active customer in the TDS repository.
Business Context
Some data such as "Items" has been saved as a Buffer as part of the imported TDS2 Base Subset. When the TestCase is run, a
dynamic Value is buffered using {XB[Items]}, which stores the number of items added to the shopping cart.
In order to update the "Items" column in the TDS repository, we must first create a TestStep in Tosca that finds/retrieves an
"Active" customer test record. Subsequently, we update that test record, namely the "Items" column in the TDS repository using
the appropriate TDS Standard Module.
Instructions
1. Navigate to the TestCase “Add items to shopping cart“ in the Folder “Exercise 3C“.
In the TestStepFolder “Search for Active Customer in TDS records“, add the TDS Standard Module
"TestData - Find & provide record“ and rename the TestStep to “Search TDS record with Active Status“.
2.
Enter the appropriate Values for the TestStepValues Existing alias name (record)* and Status to find/
retrieve the appropriate test record (i.e. constrain the search for an "Active" customer) in the TDS repository.
Add the relevant TDS Standard Module in the TestStepFolder “Update TDS record with Items in
Shopping cart“ and rename the TestStep to “Update TDS record with buffered Items“.
3.
Enter the appropriate Values to update the Buffered number of items in the TDS repository
4. Run the TestCase in the Scratchbook.
5. Update the WorkState of the TestCase to COMPLETED and save your changes.
6. Refresh the Test Data Management page in the web browser to view the changes in the TDS repository.
17
RETRIEVING AND UPDATING TEST RECORDS THROUGH TDS
Business Context
The data for "Items" and "OrderNumber" have been saved as Buffers in the TestSteps as part of your imported base Subset. We
will need to change the "OrderStatus" to "Pending" to indicate the beginning of the customer purchasing process.
Instructions
1. Navigate to the TestCase “Purchase items in the web shop“ in the Folder “Exercise 3D“.
In the TestStepFolder “Search for Active Customer in TDS records with Items in Cart“, add the TDS
Standard Module "TestData - Find & provide record“ to constrain the search for an “Active“ customer and
2.
the Buffered number of items in the shopping cart. Rename the TestStep to “Search Active customers with
Items in cart“.
3. Enter the data as per the table below:
In the TestStepFolder “Update TDS records with Order Number, Order Status & Items in Cart“, add
the relevant TDS Standard Module to update the test record and rename the TestStep to “Update TDS
records“.
4.
Enter the appropriate Value and Action Mode for the TestStepValue Existing alias name (record)*. Buffer
the TestStepValues Items as well as OrderNumber, and set the OrderStatus to "Pending".
5. Run the TestCase in the Scratchbook.
7. Refresh the Test Data Management page in the web browser to view the changes in the TDS repository.
18
Exercise 03E | Process Payments through Non-UI
Objective
By the end of this exercise, you will able to process the customer's order payment in the DemoWebShop created in the
previous exercises to its desired state through non-UI (API) testing.
Business Context
In order to process the customer's payment, we must first search for a customer with a "Pending" OrderStatus. Then, we will
use non-UI Modules to change the OrderStatus to "Processing" in the backend of the DemoWebShop.
Instructions
1. Navigate to the TestCase “Process payments through non-UI“ in the Folder “Exercise 3E“.
In the TestStepFolder “Search for Pending OrderStatus in TDS records“, add the relevant “TDS Standard
2. Module“ to constrain the search for the “Pending“ OrderStatus (different than Status) and rename the
TestStep to “Search for pending OrderStatus“. Enter the appropriate Values and Action Modes.
3. Navigate to the TestStepFolder “Payments are processed“ which contains the non-UI TestSteps.
Expand all the items under the TestStep of the Request node named “SetOrderPaymentPaid“ and enter the
relevant test data from the TDS records as per the table below:
4.
Note: It is not necessary to modify any other information in this TestCase.
6. Update the WorkState of the TestCase to COMPLETED and save your changes.
Hints
»» Be careful not to confuse "OrderStaus" (the status of the order) with "Status" (the status of a customer).
19
RETRIEVING AND UPDATING TEST RECORDS THROUGH TDS
Business Context
To reflect the changes in the TDS repository, we must first change the OrderStatus from "Pending" to "Processing". We must
also change the Status of that customer to "Used" to show that their order has been successfully processed.
Instructions
1. Navigate to the TestCase "Process purchase order" in the Folder "Exercise 3F".
In the TestStepFolder "Search for Pending OrderStatus in TDS records", add the relevant TDS Standard
2. Module to constrain the search to a “Pending“ OrderStatus (different than Status) and rename the TestStep
to "Search for pending OrderStatus". Enter the appropriate Values and Action Modes.
In the TestStepFolder "Update TDS records with Processing Order Status", add the relevant TDS
Standard Module to update the TDS record and rename the TestStep to "Update Status & OrderStatus".
3.
Enter the appropriate Values for the TestStepValues Existing alias name (record)*, "OrderStatus" and
"Status" with their appropriate Action Modes to indicate the relevant updates of the completed customer
order process.
4. Run the TestCase in the Scratchbook.
5. Update the WorkState of the TestCase to COMPLETED and save your changes.
6. Refresh the Test Data Management page in the web browser to view the changes in the TDS repository.
20
Exercise 03G | Move used records to other TDS Type
Objective
By the end of this exercise, you will move the “Used“ customer records from the existing TDS type to another TDS type using
the TDS Standard Module "TestData - Move record to TDS type".
Business Context
Here, we first search for the customer records with the Status “Used“ and move those test records to a new TDS Type named
"CustomerDetails_Used". As the Alias name (record) field is kept blank, it automatically takes the existing TDS Type as an Alias
name. This means, when moving those test records, the Existing alias name (record)* will take the same Value as the existing
TDS Type.
Instructions
1. Navigate to the TestCase "Move used record to other TDS Type" in the Folder "Exercise 3G".
In the TestStepFolder "Search for used TDS records", add the relevant TDS Standard Module to constrain
2. the search to a customer with the “Used“ Status and rename the TestStep to "Search for used customer
status". Enter the data as per the table below:
In the TestStepFolder "Move used records to other TDS type", add the relevant TDS Standard Module to
3. move the TDS records to a new TDS Type. Rename the TestStep to "Move used customer records" and
enter the appropriate Values and Action Modes as per the table below:
Move used customer Existing or new TDS type* CustomerDetails_Used Set the correct Action Mode
records Existing alias name (record)* Enter the correct Value Set the correct Action Mode
5. Update the WorkState of the TestCase to COMPLETED and save your changes.
6. Refresh the Test Data Management page in the web browser to view the newly created TDS Type.
21