Forum Discussion

longchasen's avatar
longchasen
Contributor
7 years ago

Access parameter variable in OnSetup

I created an extension with a parameter   <Parameter Name="SourceFileName"></Parameter>   Im trying ton acess the value of this parameter in onSetup event like this:   function MyExtensio...
  • tristaanogre's avatar
    7 years ago

    Parameters in Keyword Operations extensions don't have a data type.  They are a construct in the XML that is used to pass information into whatever script code you are using for the operation.  Until data is actually assigned to the parameter, you won't know what the data type is.  So, in the SetupRoutine, if the parameter values have not been set, either as default values in the XML or in the OnCreate event handler, then you won't get any values or datatypes.


    If you haven't done so already, take a look at the example of the OnSetup event handler in the help.  This seems to be the best scenario for checking data types on form setup.

    https://support.smartbear.com/testcomplete/docs/working-with/extending/script/creating/keyword-test-operations/setup-routine.html