06-20-2012, 12:14 AM
Hello,
Goal: From the qtp main starting file, initialize an array of classes, and pass that array as a parameter to a re-usable action via a parameter.
Problem: I am not able to pass an array of classes to my re-usable action.
I have the main startup file which we will reference as “application_main”.
I have a re-usable action which we will reference as “personal_action”
Inside application_main, we have a call to InvokeApplication, proceeded by a few other declarations.
I am able to initialize my array of classes fine (variable name: “myArray”). I proceed to pass that array as a parameter as follows in my application_main:
RunAction “personal_action”, oneIteration, customParam1, customParam2, myArray
On the personal_action page, I have the ability to edit the parameter properties via Edit->Action->Action Properties. I select the Parameters tab. In it, I am able to define the incoming parameters as:
String, Boolean, Date, Number, Password, Any
Since “array” is not available, I select “Any”.
Upon running, I am prompted with this:
The array is the third parameter being passed, and the third parameter type is “any”.
My Question: Why am I not able to pass an array to an action from the main startup file? Does anyone know of a way to do this?
Any help is appreciated. Thank you.
Goal: From the qtp main starting file, initialize an array of classes, and pass that array as a parameter to a re-usable action via a parameter.
Problem: I am not able to pass an array of classes to my re-usable action.
I have the main startup file which we will reference as “application_main”.
I have a re-usable action which we will reference as “personal_action”
Inside application_main, we have a call to InvokeApplication, proceeded by a few other declarations.
I am able to initialize my array of classes fine (variable name: “myArray”). I proceed to pass that array as a parameter as follows in my application_main:
RunAction “personal_action”, oneIteration, customParam1, customParam2, myArray
On the personal_action page, I have the ability to edit the parameter properties via Edit->Action->Action Properties. I select the Parameters tab. In it, I am able to define the incoming parameters as:
String, Boolean, Date, Number, Password, Any
Since “array” is not available, I select “Any”.
Upon running, I am prompted with this:
Code:
The type you specified for the ‘myArray’ parameter in your RunAction statement does not match the type defined in the action.
The array is the third parameter being passed, and the third parameter type is “any”.
My Question: Why am I not able to pass an array to an action from the main startup file? Does anyone know of a way to do this?
Any help is appreciated. Thank you.