SURESHKUMAR.NET FORUMS
Registered Member Login:
Not a member? Register today!



Welcome to the SURESHKUMAR.NET FORUMS.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.




How to solve this function .. in QTP

        

Reply
 
LinkBack Thread Tools Display Modes
Old 04-05-07, 09:13 PM   #1 (permalink)
Junior Member
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 3 subbu_123 is on a distinguished road
How to solve this function .. in QTP

Hai everybody

Can anybody give solution for this...

In QTP..flight application ... I want to test one function i.e. Whether application displaying correct Total price according to no of passengers selected...

Total Price = No of passengers selected * single ticket price

1). I retrived property value into variable through GetROProperty... but it is storing price with $ symbol ... for Total Price, Single Price ticket...then it is not possible to calculate ...how to eliminate doller symbol .

2). when i retrieved into variable ...if that value is decimal number it is not possible to compare ...

Open default 4th record and try to solved this problem...

In Winrunner we have split function we use for this type of problem but what is function we use in qtp


SEND DETAILED PROCEDURE WITH SCRIPT

subbu_123 is offline Offline   Reply With Quote
Old 07-05-07, 05:43 PM   #2 (permalink)
Junior Member
 
Join Date: Sep 2006
Posts: 40
Thanks: 0
Thanked 12 Times in 6 Posts
Rep Power: 5 kompella2006 will become famous soon enough kompella2006 will become famous soon enough
Re: How to solve this function .. in QTP

in QTP we r using mid function..
it is remove unwanted chars....
mid(length,value,position)used
2) uncan change decimal number into integer use int function it is change into integer
int a
msgbox(a)


subbu
kompella2006 is offline Offline   Reply With Quote
Old 29-10-07, 02:23 PM   #3 (permalink)
Junior Member
 
Join Date: Sep 2006
Age: 25
Posts: 16
Thanks: 1
Thanked 17 Times in 6 Posts
Rep Power: 5 sudhanandareddy has a spectacular aura about sudhanandareddy has a spectacular aura about
Re: How to solve this function .. in QTP

Hi,

There is no need to use of MID Function...we can use Abs Function to get eliminate $ symble..Here I am sending script..

tickets = window("Flight Reservation").WinEdit("Tickets:").GetROProperty("Text")
prices = window("Flight Reservation").WinEdit("Price:").GetROProperty("text")
total = window("Flight Reservation").WinEdit("Total:").GetROProperty("text")

pavan = abs(prices)
nanda = abs(total)

If nanda = cint(tickets)*pavan Then
msgbox "True"
else
msgbox "False"
End If


int a will not work in VB script. here we use CInt(a)..

If any queries regarding this do mail @ nanda.dreddy@gmail.com
sudhanandareddy is offline Offline   Reply With Quote
Reply

Tags
function , qtp , solve


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
C questions Spoorthi DATA STRUCTURES, C, C++, VC ++ 9 05-11-09 02:18 PM
Some Loadrunner FAQs kiran2710 Testing Tools & QA 1 25-10-08 12:42 AM
Function pointers- simple example jithendra.b ds. c , c++ Interview / Technical Questions 1 30-03-07 03:31 PM
TCS Pacement paper 29 sridhar TCS Placement Papers 0 12-02-07 05:43 PM
What’s the difference between thesr shilpa VB / ASP.NET Technologies 5 08-03-06 12:09 PM


All times are GMT +6.5. The time now is 11:07 AM.

More Interview Questions Here...

Content Relevant URLs by vBSEO 3.3.0