Micro Focus QTP (UFT) Forums
Executing RunAction along with Function Call - 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 Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Executing RunAction along with Function Call (/Thread-Executing-RunAction-along-with-Function-Call)



Executing RunAction along with Function Call - danny2012 - 04-12-2013

Action 1:
Code:
Dim a, b, c
a = 10
b = 20
c = 30


RunAction "Action2", 0, "Login_To_AUT " & """ & a & """, """ & b & """, """ & c & """

Action 2:

Code:
func = Parameter("Function")
spc_func = InStr(1,func ," ")
environment.Value("FnName") = Mid(func ,1,spc_func -1)
Execute func

Function Login_To_AUT(ByVal a, ByVal b, ByVal c)

    Print a
    Print b
    Print c

End Function


Whenthe test was executed it stops at Action 1 of 'RunAction' Statement and displayed the below error.

You specified more parameters in your RunAction statement than the number of parameters defined for the action.

Could you please someone help to find what is the problem with the RunAction statement.


RE: Executing RunAction along with Function Call - Saket - 04-15-2013

try replacing your RunAction Statement -
Code:
RunAction "Action2", 0, "Login_To_AUT " & a & "," & b & ", " & c