Ryan_Moran
5 years agoValued Contributor
importing function from javascript to keyword test
Attempting to use
require("MyCommonUnit").myFunction("someparameter")
within a keyword test statement such as Set Variable Value
Seems like this should work, but returns an error:
Unable to evaluate the operation's "NewValue" parameter. Error: Error: Unable to find the specified module
In my script I have the following:
// [MyCommonUnit] module.exports.myFunction = some_function; function some_function() { //does stuff
return someValue; }
Anyone have an idea why this doesn't work or perhaps an alternate method to use?
You can... if the function returns something, you can still use the Set Variable value after the script function call and set the "mode" of the set variable to "Last Operation Result". This will take whatever the result is of the function call and assign it to the variable value.