Highlighted
Super Contributor.
Super Contributor.
311 views

Understanding the [ Parameter("pvX") = X ] statement in UFT

Jump to solution

Inside a function are statements like:
DIM X   'dimensions the variable X
X = "A_String"
Parameter("pvX") = X

I searched for a Parameter statement like above in a VBScript manual: not there.
It must be a UFT feature.
I searched the UFT User Manual for "Parameter" and saw lots of examples like:
     Parameter("pvX") = X
but no explanation of what the Parameter( )  statement is or actually does.

From what I can guess, the Parameter( ) statement is sort of like the DIM in that it allocates a piece of memory for a variable that is used to pass parameters between UFT Actions / functions, but the scope of the variable created with the Parameter( ) statement extends beyond the Action or function that is in focus, while the DIM created variable is limited to only within the Action or function that is in focus.

Or maybe variables created by the Parameter( ) statement are "public" while variables created by the DIM statement are "private" ?

Please explain the use of Parameter( ) .
In Linux lingo, is there a man page on Parameter( ) ?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Honored Contributor.
Honored Contributor.

In UFT, parameters are used to drive data. Instead of hard coding data, you create parameters and then you can pass data to these parameters at runtime, generally using the datasheet. This makes your tests reusable for various sets of data. 

There are three type of parameters, input parameters, output parameters and local parameters (for business components).

If you use ALM, you can then link parameters between tests, so that you can reuse a value output from one test into another. 

This is a very brief overview. You should be able to find reference in the below guide, you should also find examples in the tutorial as well, on how to create and use parameters. check out the training or tutorial guide.

https://admhelp.microfocus.com/uft/en/14.00/AutomationObjectModel/  

Example: 

You can assign value to parameter("username") from the data sheet  or

parameter("username")="Test" , where it acts like a variable, but its purpose and scope are different when used with or without ALM.

Browser("B").Page("P").WebEdit("Username").set parameter("username")

Here the input value for the set method is passed using parameter("username"). You can have this in the global data sheet 

Hope this helped.

GoScriptLESS Create UFT Tests in seconds view demo and more details at scriptlessautomation.com

View solution in original post

3 Replies
Highlighted
Honored Contributor.
Honored Contributor.

In UFT, parameters are used to drive data. Instead of hard coding data, you create parameters and then you can pass data to these parameters at runtime, generally using the datasheet. This makes your tests reusable for various sets of data. 

There are three type of parameters, input parameters, output parameters and local parameters (for business components).

If you use ALM, you can then link parameters between tests, so that you can reuse a value output from one test into another. 

This is a very brief overview. You should be able to find reference in the below guide, you should also find examples in the tutorial as well, on how to create and use parameters. check out the training or tutorial guide.

https://admhelp.microfocus.com/uft/en/14.00/AutomationObjectModel/  

Example: 

You can assign value to parameter("username") from the data sheet  or

parameter("username")="Test" , where it acts like a variable, but its purpose and scope are different when used with or without ALM.

Browser("B").Page("P").WebEdit("Username").set parameter("username")

Here the input value for the set method is passed using parameter("username"). You can have this in the global data sheet 

Hope this helped.

GoScriptLESS Create UFT Tests in seconds view demo and more details at scriptlessautomation.com

View solution in original post

Highlighted
Super Contributor.
Super Contributor.

Thank you for the reply and the URL for more information.

You provided the the answer to my question.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Thanks for the help!
The link you provided was "not found"
I found the Automation Object Model page here:
https://admhelp.microfocus.com/uft/en/14.00/UFT_Help/Content/User_Guide/Use_QT_Obj_Model_Ref_Comp.htm

The admhelp.microfocus.com web site wanted me to look in uft/en/14.03 though. That would probably have the same information, but I went to 14.00 like you recommended.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.