Active Topics Memberlist Calendar Search Help | |
Register Login |
One Stop Testing Forum : Testing Tools @ OneStopTesting : Rational Robot @ OneStopTesting |
Topic: Adding Logic to the Test Script |
|
Author | Message |
tanushree
Senior Member Joined: 04Apr2007 Online Status: Offline Posts: 2160 |
Topic: Adding Logic to the Test Script Posted: 31Oct2007 at 3:17am |
Adding Logic to the Test Script
Adding Logic to the Test Script In this exercise you will program decision-making logic into the test script using 3 Add a comment to describe what this section of the script will do.an if/else statement. This enables the test to: • check that the total is equal to the number of tickets ordered multiplied by the price per ticket • report whether the total is correct or incorrect 1 Place the cursor below the last edit_get_text statement in the lesson7 script. 2 Add the following statements to the test script exactly as they appear below. Note that the tabs or spaces at the beginning of the second and fourth lines are optional. if (tickets*price == total) tl_step ("total", 0, "Total is correct."); else tl_step ("total", 1, "Total is incorrect."); In plain English these statements mean: "If tickets multiplied by price equals total, report that the total is correct, otherwise (else) report that the total is incorrect." Place the cursor above the if statement you added in the previous step. Choose Edit > Comment. After the # sign, type: check that the total ticket price is calculated correctly. 4 Save the test. Post Resume: Click here to Upload your Resume & Apply for Jobs |
|
IP Logged | |
Forum Jump |
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
© Vyom Technosoft Pvt. Ltd. All Rights Reserved.