SoapUI

Overview

Test Scenarios

* Data driven testing
– with data from property files or database.
* Template driven testing
– Execute data driven testing sequentially.
* Groovy scripting testing
– Use user input dialogues
* Headless testing
– Integrate with build process.

SoapUI Project

Create a New SoapUI Project

* File -> New SoapUI Project
– Enter project name such as ‘Localhost-EchoService’.
– Enter Initial WSDL URL such as ‘http://localhost/axis/services/echo?wsdl’
– Leave checked for ‘Create sample requests for all operations?’
– Click ‘OK’ button.

Simple Testing Web Services

* Click ‘+’ sign and drill down to one of the operations until you see ‘Request 1’.
* Double click ‘Request 1’.
– Replace ‘?’ marks with your own values.
– Click the green arrow located at the upper left corner to send in the request.
– Check the response on the right panel.

Test Suite

Create a Test Suite

* Right click project and select ‘New TestSuite’
– Enter name for the test suite such as ‘Echo TestSuite 1’.
– Click ‘OK’ button.

Create a Test Case

* Right click newly created test suite and select ‘New TestCase’
– Enter name for the test case such as ‘EchoString TestCase 1’.
– Click ‘OK’ button.

Create a New Test Case Request

* Add request to test case
– Right click the request (echoString -> Request 1) to be added to test case and select ‘Add to TestCase’.
– Select ‘Echo TestSuite 1 – EchoString TestCase 1’ from the drop down list.
– Click ‘OK’ button.
* Specify test case options
– Enter name such ‘echoString – Request 1’.
– Check available options.
– Click ‘OK’ button.

Specify Assertions

* Open the Assertions window by clicking the ‘Assertions’ tab located to the bottom the SoapUI GUI.
* Click the ‘Add an assertion…’ icon which is the first icon of the Assertions window.
* Select assertion to add, such as ‘Contains’.
* Click ‘OK’ button.
* Specify assertions such as Content: Hello World.

Run Test Suite

* Click the green run button to start testing.

Load Test

* Load test is created against each test case.

Create a New Load Test

* Right click the Test Suite and select ‘New LoadTest’.
– Enter name for the new load test.

Load Test Configurations

* Threads: Simulate number of users
* Strategy: Simulate invoke intervals and activities
– Burst: simulates bursts of users.
– Simple: each thread is invoked at regular intervals.
– Variance: active thread numbers increase/decrease variously.
– Thread: defines start thread numbers and end thread numbers.
* Assertions
– Click the ‘LoadTest Assertions’ tab on the bottom of the UI to open the LoadTest Assertions windows.
– Click the ‘Add an assertion…’ button to the upper left of the LoadTest Assertions window to add an assertion such as:
~ Max numbers of errors
~ Min numbers of transactions per second
~ Max time to run the test

SoapUI Command Line

C:\prog\soapui-3.5.1\bin>testrunner.bat
soapUI 3.5.1 TestCase Runner
usage: testrunner [options] <soapui-project-file>
 -v    Sets password for soapui-settings.xml file
 -t    Sets the soapui-settings.xml file to use
 -A    Turns on exporting of all results using folders instead of long
       filenames
 -D    Sets system property with name=value
 -G    Sets global property with name=value
 -I    Do not stop if error occurs, ignore them
 -P    Sets or overrides project property with name=value
 -S    Saves the project after running the tests
 -a    Turns on exporting of all results
 -c    Sets the testcase
 -d    Sets the domain
 -e    Sets the endpoint
 -f    Sets the output folder to export results to
 -h    Sets the host
 -i    Enables Swing UI for scripts
 -j    Sets the output to include JUnit XML reports
 -p    Sets the password
 -r    Prints a small summary report
 -s    Sets the testsuite
 -u    Sets the username
 -w    Sets the WSS password type, either 'Text' or 'Digest'
 -x    Sets project password for decryption if project is encrypted
Missing soapUI project file..

* Example

C:\prog\soapui-3.5.1\bin>testrunner.bat -r C:\test\soapui\my-soapui-project.xml
 
SoapUI 3.5.1 TestCaseRunner Summary
-----------------------------
Time Taken: 9567ms
Total TestSuites: 1
Total TestCases: 1 (0 failed)
Total TestSteps: 7
Total Request Assertions: 0
Total Failed Assertions: 0
Total Exported Results: 0

References

* http://www.soapui.org/
* Java Power Tools By: John Ferguson Smart

This entry was posted in wstest and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.