Geeks Talk

Prepare for your Next Interview




Calculations in WinRunner

This is a discussion on Calculations in WinRunner within the WinRunner forums, part of the Software Testing category; When I try to multiply the values for flight application to find the total price of tickets(selecting the classes randomly) it does not get multiplied. Here is the script ...


Go Back   Geeks Talk > Software Testing > WinRunner

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-29-2008
Junior Member
 
Join Date: Jun 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Aparna_K is on a distinguished road
Calculations in WinRunner

When I try to multiply the values for flight application to find the total price of tickets(selecting the classes randomly) it does not get multiplied. Here is the script I created:


Please Help

public status[]={"First","Business","Economy"};
for(i=nt0;i<=3;i++)
{
var=int(rand()*3)+1;
set_window("Flight Reservation",1);
#button_set(arr[var],ON);

switch (var)
{
case 1 : First;
button_set("First",ON);
#price=obj_check_gui("First", "first.ckl", "gui24", 1);
#price=obj_check_gui("First", "first.ckl", "gui25", 1);
edit_get_text("Price:", price1);
report_msg("First class price is:" & price1);
edit_get_text("Tickets:",tickets);
edit_get_text("Total:",total);
total2=price1*tickets;
report_msg("Application Total is: " & total);
report_msg("Calculated Total is: " & total2);
break;

Similar code for rest of the classes.


What about subtraction I am trying to compare the difference between two classes. i.e. First class and economy class and the price should be equal to
224.4 --- This dos not get subtracted. Here is the code:

button_set("First",ON);
edit_get_text("Price:",price1);
report_msg("Price of firstclass is:" &price1)

button_set("Economy",ON);
edit_get_text("Price:", price2);
report_msg("Price of economy is:" &price2)

if((price1-price2)== 224.4)
tl_step("Price Ticket:", 1, "Price ticket difference is not equal");
else
tl_step("Price Ticket:", 0, "Price difference ticket is equal");
Reply With Quote
Sponsored Links
Reply

  Geeks Talk > Software Testing > WinRunner


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Math Calculations - Unix Shell basehit524 Unix/Linux 2 07-26-2008 09:10 AM
Winrunner raghav284 WinRunner 1 06-13-2008 04:03 AM
WinRunner SowmyaManjunath WinRunner 4 05-13-2008 04:56 AM
What is a bug for WinRunner? eiman WinRunner 3 10-16-2007 06:16 AM
Help and FAQ On Winrunner abh_san WinRunner 2 12-08-2006 11:42 AM


All times are GMT -4. The time now is 08:10 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved