Editing Test Scripts with QaSCRIBE
Before you read this article you may want to see:
- Building Test Scripts with QaSCRIBE
- Executing Test Scripts with QaSCRIBE
- QaSCRIBE Overview
- Installing QaSCRIBE
- Launching QaSCRIBE
Main Article
Edit test scripts that have been created with QaSCRIBE.
Let us take the following test script that searches for the book 'Steve Jobs' by Walter Isaacson:
This test script opens amazon.com and searches for 'steve jobs biography' under Books. It then looks for the book titled 'Steve Jobs' in the search results, clicks on the link to the book, and then adds it to the cart.
Let's say you want to modify this script to verify that this book is written by Walter Isaacson before you select it. You can see from the Amazon screen with the search results shown below that there is another link (highlighted) with a link name Walter Isaacson and a display text of Walter Isaacson.
You just need to look for this text and the link to verify that you have the correct author. This will require you to add another instruction between the 5th and the 6th instruction in the script shown above.
There are two ways to do this.
Approach 1
Step 1: You can add the new instruction by clicking on the 'Add' icon which is available on the 5th instruction as shown below:
Step 2: Now you can view a grid with the Command Details Pane and type in waitForText in the Command field, link=Walter Isaacson in the Target field and Walter Isaacson in the Value field as shown below:
Step 3: Save the script and you are done!
Approach 2
Step 1: Place your cursor on the 5th instruction (click xpath=(//*[text()="Steve Jobs"])[2]) as mentioned above and turn on the recording button.
Step 3: Turn off the recording. Save the script and you are done!