Prepare for your Next Interview
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 ...
|
|||
|
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"); |
| Sponsored Links |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| 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 |