Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Highlighted
Absent Member.. vzamoraz Absent Member..
Absent Member..
136 views

QTP/UFT support tip: Considerations using RunAction

When you have an scenario where you pass test parameters to the actions and you use RunAction method to call the actions is important to know that values will be pass when you run the test completely, If you use Right-click > Run from Step the test parameter can't be passed from Test -> Action -> SubAction.

 

Example:

You have Test1 with:

Action1  with input parameter ActionParam1 and Value "Action1Default"

Action2  with input parameter ActionParam2 and Value "Action2Default"

 

You have Test2 with:

Input parameter TestParam and Value "TestValue"

Action3  with input parameter ActionParam3 and Value "Action3Default"

 

 

Now from Action3 you call Action1 and Action2 and then pass the TestParam to Action1 and Action2

So you will have something like this:

 

Note: You need to pass the TestParam first to Action3 Parameter and then pass it to Action1 and Action2

 

From code you will have this

 

RunAction "Action1 [Test1]", oneIteration, Parameter("ActionParam3")

RunAction "Action2 [Test1]", oneIteration, Parameter("ActionParam3")

 

 

If you run the entire test it will pass the value "Test Value".

However if you right click and select Run from step SM2.png it will pass "Action3Default"

 

Because when you use run from step the test level is not executed since this mechanism is to run from a specific point in the code.

 

Hope this helps

 

Regards.

 

 

 

HP support
If you find that this or any post resolves your issue, mark it as an accepted solution.

 

 

Note: The Opinions expressed in my post are mine alone, and do not reflect the opinions of my employer. No warranties express or implied for any answered posted.

 

Labels (1)
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.