Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript in SoapUI

Javascript in SoapUI How to's?

In SoapUI, you are allowed to write Groovy Scripts ! but since even javascript is also supported in SoapUI how can we write a javascript in SoapUI Is there a simple example which would explain this in much detail.Is there any simple code for automating the process of testing using javascript.

like image 632
Namita Avatar asked Jan 18 '13 09:01

Namita


People also ask

Can we use JavaScript in SoapUI?

SoapUI provides extensive options for scripting, using either Groovy or Javascript (since SoapUI 3.0) as its scripting language, which to use is set a the project level in the project details tab at the bottom left.

How do I enable JavaScript in SoapUI?

To switch a project to JavaScript, click on the project, travel to the window in the bottom left hand corner. Select the script language field and update it to JavaScript.

Why is groovy scripting used in SoapUI?

Uses of Groovy Script in SoapUI tool for API or Web service testing. The groovy script is used to generate and provide data into the groovy test request. It is used to verify the groovy response.


1 Answers

To switch a project to JavaScript, click on the project, travel to the window in the bottom left hand corner. Select the script language field and update it to JavaScript.

As far as what you can do with it, you can really do anything. You can create a script step or assertion. Some examples would include creating a script to create variables or looping through a response to verify information. I didn't find much on using JavaScript with soapUI either, and ended up sticking with Groovy. I found it to be powerful and extendable via Java if needed.

If you want a specific example on how to do something. I'd recommend asking a more specific question with what you have tried so far.

like image 98
Steve Miskiewicz Avatar answered Oct 01 '22 19:10

Steve Miskiewicz