Prepare for your Next Interview
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 05: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 01:03 AM. Reason: Code Alteration |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Return Value of Functions | janelyn | C and C++ | 3 | 09-24-2007 01:09 AM |
| Can void be the return value of main Function | joel | C and C++ | 3 | 09-10-2007 01:21 AM |
| Can Functions Return more than 1 value | Geek_Guest | Oracle | 2 | 07-20-2007 12:47 PM |
| The Return Of Kalayama! | kalayama | Get Together | 3 | 01-14-2007 02:17 AM |
| What is the Return Value | RajivPrasad | ASP.NET | 1 | 10-09-2006 03:17 PM |