Access parameter variable in OnSetup
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 MyExtension_OnSetup(Data,Parameters){
...
aqDlg.MessageDlg( aqObject.GetVarType(Parameters.SourceFileName),2,4);
aqDlg.MessageDlg( Parameters.SourceFileName,2,4);
...
return true;
}
As you see im testing the parameter value and data type, if im using contant value it display both the value and type however for table variables like the one in excel it dont display the value and data type. I understand that the actual data will be evaluated in execution but at least i want to retrieve the variable name like something "KeywordTests.ProjectTest.Variables.Var3("VALUE")".
Solved! Go to Solution.
- Labels:
-
Data-Driven Testing
-
Script Extensions
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's usually easier to help if you give us a screenshot of your code rather than an approximation. Can we see that please?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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-...
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
