Prepare for your Next Interview
|
Welcome to the Geeks Talk forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
This is a discussion on how to return value from a function in QTP? within the QTP forums, part of the Software Testing category; below is giving error: Please correct them msgbox getSomething() A return type must be declared? Function getFlatRate() s = browser("B").Page("p").WebElement("we").GetROProperty("something") return s End Function...
|
|||||||
|
|||
|
how to return value from a function in QTP?
below is giving error: Please correct them
msgbox getSomething() A return type must be declared? Function getFlatRate() s = browser("B").Page("p").WebElement("we").GetROProperty("something") return s End Function |
| Sponsored Links |
|
|||
|
Re: how to return value from a function in QTP?
Hi try this,declair !
dim c if c = window("flight reservation").winbutton("flight").getroproperty("flight") then window("flight reservation").winbutton("flight").click if c = c then reporter.reportevent micpass,"flight button enabled ","clicked" else reporter.reportevent micfail,"flight button enabled","failed to clicked" end if end if Last edited by Fahed9090; 07-17-2008 at 06:46 PM. |
| The Following 2 Users Say Thank You to Fahed9090 For This Useful Post: | ||
|
|||
|
Re: how to return value from a function in QTP?
Just assign the value to be passed outside to the function name as below. Also for multiple variable outputs from functions use Call by Reference method.
msgbox getFlatRate() Function getFlatRate() s = browser("B").Page("p").WebElement("we").GetROProperty("something") getFlatRate= s End Function |
|
|||
|
Quote:
msgbox getFlatRate() Function getFlatRate() s = "Test" getFlatRate=s End Function Regards, Nawab Last edited by NawabShaikh; 07-18-2008 at 02:03 AM. Reason: Code Alteration |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Return Value of Functions | janelyn | C and C++ | 3 | 09-24-2007 02:09 AM |
| Can void be the return value of main Function | joel | C and C++ | 3 | 09-10-2007 02:21 AM |
| Can Functions Return more than 1 value | Geek_Guest | Oracle | 2 | 07-20-2007 01:47 PM |
| The Return Of Kalayama! | kalayama | Get Together | 3 | 01-14-2007 03:17 AM |
| What is the Return Value | RajivPrasad | ASP.NET | 1 | 10-09-2006 04:17 PM |