Lesson 5: Modularize the test script
In this tutorial, you recorded a test scenario in which you signed in to the web site,
browsed for a product, and saw pricing details. In the actual scenario, you would have also recorded
how to purchase, check out the product, and sign out of the website. You would have done that to
avoid recording the same application multiple times. However, maintaining a big test script with a
lot of data can be difficult. After the recording, you can modularize the test script by splitting
it at appropriate steps and thereby creating meaningful chunks of test scripts. For example, for the
test scenario in this tutorial, you can split the ‘Sign in’ and ‘Choosing the product’ steps and
create two test scripts out of it. You can then add these scripts to a Compound Test to run in
sequence.
Procedure
To modularize the test script:
Results
You have now moved the Choosing the product test steps from ibm-web test script to ibm-web-purchase. Note that you cannot run the ibm-web-purchase test script independently. You can run it only as part of a compound test.
Now, you will create a datapool and add data that will be used by the test.