Forum Discussion
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?
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.
- scambias8 years agoContributor
Thank you!
What a coincidence: I was registered to this webinar which was supposed to be last tuesday. I have registered for next tuesday.
Thanks again.
Kind Regards,
Silvio
Related Content
Recent Discussions
- 9 hours agoSvetaG