Micro Focus QTP (UFT) Forums
Vb scripting - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Vb scripting (/Thread-Vb-scripting)



Vb scripting - rahul1234 - 12-31-2009

Hi,
Wishing you a happy and prosperous new year.

I have an query
In Flight Reservation application how can we check that
Total Price= Ticket*Price
And how can we get that value in our design time data table.


RE: Vb scripting - upadhyay40 - 12-31-2009

Hi rahul,

For checking total price = Ticket * Price, you can use conditional statement like, if.. else or check the value you can use table check point (For the same you can follow the QTP tutorial for checkpoint), hope this might solve your problem.

Thanks
Mahesh


RE: Vb scripting - sreekanth chilam - 12-31-2009

Hi,

Note: Values retrieved & posted during the RunTime will not be seen in Design Time Datatable.

You can get the value into RunTime Datatable of Test Results window.
Code:
total_price = Ticket * Price
Datatable("TotalPrice",dtGllobalSheet).Value=total_price

@Forum members: HAPPY NEW YEAR TO U Smile


RE: Vb scripting - bfakruddin - 01-04-2010

First get the values available in "Tickets" and "Price" fields

and Multiply both the values and keep in one Variable and Use that value where ever you want

Code:
Dim No_of_Tickets,Price_of_Tickets

No_of_Tickets=Object.getroproperty("value")
Price_of_Tickets=Object.getroproperty("Value")

Result=No_of_Tickets*Price_of_Tickets

msgbox "Price of Tickets"&Result

'You can use this variable as a parameter and pass to your desired place