08-26-2009, 12:26 PM
Is there a statement that can return an expression to the calling function or test in QTP like the RETURN function in WinRunner.
Statement that can return an expression to the calling function
|
08-26-2009, 12:26 PM
Is there a statement that can return an expression to the calling function or test in QTP like the RETURN function in WinRunner.
08-26-2009, 12:39 PM
You will be able to return an expression from function by assigning to the same function like following example-
Code: Function ChkReturn() and an expression can be returned from reusable by using ouput parameter
08-26-2009, 12:43 PM
Hi,
Here is the sample code and let me know if you need any more info. Code: 'this function will return the value is true or false
Thanks,
SUpputuri
08-26-2009, 01:10 PM
My exact question is as we have a 'Return' keyword in WinRunner which are used in fucntions. So is there any QTP equivalent fucntion/keyword for 'Return'.
My objective is to migrate a WR code to QTP code. For eg: Code: public function func1(str var1)
08-26-2009, 01:13 PM
you can use the same code in QTP, Only you need to replace return with func1
here is your QTP code Code: public function func1(var1)
08-26-2009, 01:23 PM
It is through Byref,
Code: Function func1 (Byref var1)
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
08-26-2009, 05:59 PM
Thanks a lot for solving the above.
Mentioned below are few others for which I need help from your guys.. Could any one suggest the Equivalent QTP funtions for the below mentioned WR functions: 1. getvar - getvar Returns the value of a testing option/configuration parameter. Examples: 1. old_t = getvar ("timeout"); 2. old_d = getvar ("delay"); 2. match - finds the occurrence of a regular expression in a string. This function returns the location in the string at which the regular_expression is found. The value returned is the character position at which the regular expression starts. 3. treturn - The treturn statement is used when calling a test. It stops a called test and returns control to the calling test. It also provides a return value for the called test. 4. getenv - returns the value of any environment variable, as defined WinRunner runtime environment. getenv function reads the current value of an environment variable.
08-26-2009, 06:06 PM
Prabhu -
Stop posting duplicate posts in multiple Categories.The original Post can be found at https://www.learnqtp.com/forums/Thread-Q...-functions Thread Hijack !!! Locked.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life. |
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Calling a function in a Test Script from a function library | anupam4j | 3 | 6,115 |
06-26-2015, 12:31 AM Last Post: babu123 |
|
Function return value is not passed during the 3rd iteration | premanand1979 | 0 | 2,256 |
10-16-2014, 09:40 PM Last Post: premanand1979 |
|
Get the function name calling the function | Shridevi.Salagare | 1 | 3,746 |
09-07-2013, 05:07 AM Last Post: jacosta |
|
getElementByid("myObhectId") return null??? | qtptester | 3 | 7,103 |
02-01-2013, 09:44 AM Last Post: ravi.gajul |
|
Calling a HP Service Test Skript | Gandalf2005 | 0 | 2,115 |
09-05-2012, 07:53 PM Last Post: Gandalf2005 |