0% found this document useful (0 votes)
16 views7 pages

TDS2 Exercise 03 v1.0

The document outlines a series of exercises focused on retrieving, updating, and managing test records in the TDS repository using TDS Standard Modules. Each exercise has specific objectives, such as finding customers with certain statuses, updating records, and processing orders, all while ensuring data consistency in a distributed environment. The exercises culminate in moving used records to a different TDS type for efficient management.

Uploaded by

Kuldeep Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views7 pages

TDS2 Exercise 03 v1.0

The document outlines a series of exercises focused on retrieving, updating, and managing test records in the TDS repository using TDS Standard Modules. Each exercise has specific objectives, such as finding customers with certain statuses, updating records, and processing orders, all while ensuring data consistency in a distributed environment. The exercises culminate in moving used records to a different TDS type for efficient management.

Uploaded by

Kuldeep Arora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

RETRIEVING AND UPDATING TEST RECORDS THROUGH TDS

Exercise 03A | Retrieve Test Records through TDS


Objective
By the end of this exercise you will able to retrieve test records which are stored in the TDS repository with the help of the TDS
Standard Module "TestData - Find & provide record".

Why is this important?


In order to succesfully update a test record, we must first find or retrieve it in the TDS repository, and then perform an update
on it. In this exercise, we will look for a customer with the Status “New“.

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

1. Navigate to the Folder “Exercise 3A“ in the TestCase section.


Add the TDS Standard Module "TestData - Find & provide record“ into the TestStepFolder “Find for New
2.
Customer in TDS records“ and rename it to “Find TDS record“.
3. Enter the data in the table below to find/retrieve a customer with the Status "New":

TestStep Name TestStepValue Value Action Mode


Existing or new TDS type* Enter the Value for the TDS Type Set the correct Action Mode

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:

TestStep Name TestStepValue Value Action Mode


Enter the correct Value using
Login Page Email Set the correct Action Mode
the {TD[…. ]} function

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
»» 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

Exercise 03B | Update Test Records through TDS


Objective
By the end of this exercise, you will able to update the existing TDS records present in the TDS repository with the help of the
TDS Standard Module "TestData - Update Record".

Why is this important?


This exercise demonstrates how to update test records in your database after necessary changes have been made in the
DemoWebShop application.

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:

TestStep Name TestStepValue Value Action Mode


TestStepFolder Add an Address

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.

Why is this important?


This exercise further demonstrates how to update test records in the TDS repository when a customer adds items to the
shopping cart using TDS Standard Modules in Tosca.

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

Exercise 03D | Purchase Items in the DemoWebShop


Objective
By the end of this exercise, you will be able to purchase the items that have already been added to the shopping cart in the
DemoWebShop application. You will simultaneously update the OrderNumber generated and set the OrderStatus to Pending
in the TDS repository for an Active customer.

Why is this important?


This exercise demonstrates how to perform two search criteria: 1) Active customer 2) Buffered items added into the cart.
This is used in order to find those relevant TDS records and complete the order process of an Active customer. Once this is
completed, an update is performed in the test records for Items, OrderNumber and OrderStatus in the TDS repository.

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:

TestStep Name TestStepValue Value Action Mode


TestStepFolder “Search for Active Customer in TDS records with Items in Cart“
Existing TDS type* Enter the Value for the TDS Type Set the correct Action Mode
Expand the Data structure and enter the Values for the TDS Set the correct Action Mode
Search Active customers
Attributes as below:
with Items in cart
Status Enter the correct Value Set the correct Action Mode
Items Enter the correct Value Set the correct Action Mode

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.

6. Update the WorkState of 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.

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.

Why is this important?


In order to further validate the created order, we need to process the customer's payments to its desired state using non-UI
(API) Modules.

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.

TestStep Name TestStepValue Value Action Mode


TestStepFolder Payments are processed
orderId {TD[CustomerDetails.OrderNumber]} Insert
SetOrderPaymentPaid usernameOrEmail {TD[CustomerDetails.Email]} Insert
userPassword Tricentis1 Insert

5. Run the TestCase in the Scratchbook.

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

Exercise 03F | Process Purchase Order


Objective
By the end of this exercise, you will use TDS Standard Modules to update the OrderStatus from "Pending" to "Processing" in the
TDS Repository in order to indicate that the customer's order payments have been received. We will also change the Status of
that customer to "Used" in the TDS repository.

Why is this important?


This exercise demonstrates the final steps of the End-to-End customer order process. As the earlier non-UI TestCase verified
the customer's payment and changed the OrderStatus to "Processing" in the backend of the DemoWebShop, we must now
reflect these changes in the TDS repository. This is particularly important when working in a distributed environment to make
other testers aware of the used/consumed TDS records and keep the data stateful.

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".

Why is this important?


Once data has been consumed after the End-to-End process has been completed, it is important to move those test records
to an new TDS type for efficient test record management in a distributed environment. This also ensures consistency and
accuracy in the test data, so that used or modified test records do not get reused, which would create errors in the TestCase.

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:

TestStep Name TestStepValue Value Action Mode


TestStep Folder Search for used TDS records
Existing or new TDS type* Enter the Value for the TDS Type Set the correct Action Mode
Search for used Expand the Data search filter and enter the Values for the Set the correct Action Mode
customer status TDS Attributes as below:
Status Enter the correct Value Set the correct Action Mode

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:

TestStep Name TestStepValue Value Action Mode


TestStep Folder Move used records to other TDS type

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

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 newly created TDS Type.

21

You might also like