Forum Discussion
Hi,
Sorry to hop in, but its an interesting topic!
I guess by SoapUI JavaScript documentation this is all there is https://www.soapui.org/scripting---properties/scripting-and-the-script-library.html#4-JavaScript-support - unless anyone has seen anything else?
I did a bit of experimenting, by trying to run the following script in a Groovy TestStep which I think is valid JavaScript, but not valid Groovy (please correct me if wrong):
function sayHello() {
var sayUsingLog = function() { log.info(message); }
// Local variable that ends up within closure
var message = 'Hello!';
return sayUsingLog;
}
sayHello()();
If I set the project's Script Language = JavaScript I get:
Which works.
But if I change the projects Script Language back to Groovy, it fails with:
Important Note - I think there is an annoying bug, to get the project's Script Language change to take affect I had to either restart SoapUI or close/reopen the project!
I also tried a simple Script Assertion using the below example which is valid as both Groovy and JavaScript:
var response = messageExchange.response.contentAsString; log.info (response);
That worked as JavaScript too.
Are there any specific scripts that you want to do that you can't get to work?
Hope this helps,
Cheers,
Rupert