Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin


 One Stop Testing ForumTesting Tools @ OneStopTestingRational Robot @ OneStopTesting

Message Icon Topic: Adding Logic to the Test Script

Post Reply Post New Topic
Author Message
tanushree
Senior Member
Senior Member
Avatar

Joined: 04Apr2007
Online Status: Offline
Posts: 2160
Quote tanushree Replybullet 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
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."
3 Add a comment to describe what this section of the script will do.
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 IP Logged
Post Reply Post New Topic
Printable version Printable version

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



This page was generated in 0.095 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Privacy Policy | Terms and Conditions
Job Interview Questions | Placement Papers | Free SMS | Freshers Jobs | MBA Forum | Learn SAP | Web Hosting