Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Equivalent functions for WR functions.
#1
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi,
We are trying to migrate a project from WinRunner to QTP..

Could any one suggest the Equivalent QTP funtions for the below mentioned WR functions:

1. getvar
2. return
3. match
4. treturn
Reply
#2
Solved: 11 Years, 3 Months, 2 Weeks ago
can you please explain breifly about what each function do, may be I can help you.

Reply
#3
Solved: 11 Years, 3 Months, 2 Weeks ago
1. getvar - getvar Returns the value of a testing option/configuration parameter.
Examples: 1. old_t = getvar ("timeout"); 2. old_d = getvar ("delay");

2. return - returns an expression to the calling function or test. It also halts execution of the called function and passes control back to the calling function or test. If no expression is used, then an empty string is returned.

3. 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.

4. 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.

5. getenv - returns the value of any environment variable, as defined WinRunner runtime environment.
getenv function reads the current value of an environment variable.
Reply
#4
Solved: 11 Years, 3 Months, 2 Weeks ago
Answers to whatever i can help you with,

3. 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. Instr is the function you must be looking for. Research about Instr on any vbscript help and you will know about it.

4. 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. Could be compared with Actions. You can call actions as a copy of action or existing action. The values are sent or retrieved through Input & Output Parameters.

5. getenv - returns the value of any environment variable, as defined WinRunner runtime environment.
getenv function reads the current value of an environment variable. I am not a expert on Winrunner. But from what you say i guess you are reffering to Environment.Value("env_var_name"). The usage is dynamic as well static. Try this on QTP and you will know what i mean,
Code:
oTestName = Environment.Value("TestName")
msgbox oTestName ' Will tell you the current test name.

There are 2 types of Environment Variables. Inbuilt and UserDefined. The above code will fetch data from a Inbuilt Environment variable.

Please do spend sometime with the QTP help trying to understand the above explanation.

if you have questions please post back.
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.
Reply
#5
Solved: 11 Years, 3 Months, 2 Weeks ago
Prabhu - if you can explain us exactly what do you need to do in QTP and provide with your piece of code then I think we will able to help you in much better way. Basanth's explanation seems to be great as per your definition of the functions. hope it helped you.
Just an FYI - In case you need professional help Refer Migrate_from_WinRunner_to_QTP_automatically

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error on Passing Object between functions SaranKumarV 2 3,435 02-16-2011, 10:36 AM
Last Post: SaranKumarV
  Executing Exe converted functions in QTP 9 scat 1 2,903 04-25-2008, 01:51 PM
Last Post: vaibhav_gandhi

Forum Jump:


Users browsing this thread: 2 Guest(s)