QTP Equivalent functions for WR functions. - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others) +--- Thread: QTP Equivalent functions for WR functions. (/Thread-QTP-Equivalent-functions-for-WR-functions) |
QTP Equivalent functions for WR functions. - prabhu656656 - 08-25-2009 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 RE: QTP Equivalent functions for WR functions. - Saket - 08-25-2009 can you please explain breifly about what each function do, may be I can help you. RE: QTP Equivalent functions for WR functions. - prabhu656656 - 08-25-2009 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. RE: QTP Equivalent functions for WR functions. - basanth27 - 08-26-2009 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") 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. RE: QTP Equivalent functions for WR functions. - Saket - 08-26-2009 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 |