Forum Discussion
Hi Robert,
Thank you for your answer.
I tried to, but it seems not to be working. What I get is an argument with "undefined" value.
By the way I tried also from a vbunit A to use a variabile myVar defined in unit B, by accessing with name B.myVar and it works.
Can you post your code where you're creating these constants and then post a screenshot showing how you're attempting to use them in a Keyword test?
- tristaanogre8 years agoEsteemed Contributor
Actually, just tried something in JavaScript. You cannot call variables or functions in script routines as Code Expressions in a keyword test operation parameter.
So, in order for you to have access to those constants from a Keyword operation, you will need to expose them as some sort of global object... This is where Script Extensions come into play as you can encapsulate your constants in a script extension as the properties of a Runtime Object... make them "Read Only" so they are kept as static constants.
The other option is to wrap your constants in a function that you could call and then set the result to a variable in your keyword test. You can then use that variable as a parameter to any other function call. But honestly, Script Extension is probably the way to go to make a more concise keyword test.
- scambias8 years agoContributor
Thank you Robert,
I'll give a try even if I actually don't know anything about "Script Extensions". I'll study out this topic and let you know.
Thank you again,
Silvio
- tristaanogre8 years agoEsteemed Contributor
Not a problem.
Actually, I'll be helping conduct a webinar next Tuesday on creating Script Extensions. You can register at https://attendee.gotowebinar.com/register/1015263030297249537It's actually a relatively simply process but it's EXTREMELY powerful in my opinion... rather under-utilized, I think.
Related Content
Recent Discussions
- 2 days agovladd1