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