Creating and Running Script

This section provides a tutorial example on how to create test projects with TestSuite, TestCase and TestSteps in SoapUI.

With the script TestStep created in the previous tutorial, we can now enter some script code and run the TestStep, the TestCase, or the TestSuite.

1. Double click on "HelloWorld" under "MyTestCase". You will see an empty script window open.

2. Enter one statement into the script window:

log.info("Hello world!");

3. Click the "Run" icon (a small green triangle) below the script window title bar. You will see the TestStep executed successfully with a log message displayed in the output area near the bottom:

Sun Feb 1 19:30:50 GMT 2015:INFO:Hello world!

4. Close the "HelloWorld" window and double click "MyTestCase" You will see the "MyTestCase" window open.

5. Click the "Run" icon. You will see the TestCase executed successfully with a log message displayed in the output area near the bottom:

Step 1 [HelloWorld] OK: took 14 ms.

6. Close the "MyTestCase" window and double click "MyTestSuite" You will see the "MyTestSuite" window open.

7. Click the "Run" icon. You will see the TestSuite executed successfully with a green "FINISHED" bar.

Cool. Now we know how to run a TestStep, a TestCase or a TestSuite in SoapUI.

Last update: 2015.

Table of Contents

 About This Book

SoapUI - Web Service Testing Tool

 What Is SoapUI?

 Downloading and Installing SoapUI

 Creating SoapUI Test Projects

Creating and Running Script

 SOAP Web Service and SoapUI

 REST Web Service and SoapUI

 GetCountries - Get All Countries and Territories

 GetCurrencies - Get Currencies from All Countries and Territories

 GetGMTbyCountry - Get GMT Information of a Given Country

 GetISD - Get ISD Phone Code of a Given Country

 GetCitiesByCountry - Get Cities by Country

 LatLonListCityNames - Return Latitudes and Longitudes of US Cities

 GetInfoByState - Get ZIP Codes of a Given US State

 GetAirportInformationByCountry - Get Airport Code by Country

 GetGeoIP - Get Country by IP Address

 ConvertTemp - Convert Temperature Unit

 ChangeLengthUnit - Convert Length Unit

 ConvertWeight - Convert Weight Unit

 ChangeAreaUnit - Convert Area Unit

 Code39 - Generate Bar Code Images in Code 39 Format

 GenerateBarCode - Generate Bar Code Images

 GetMortgagePayment - Calculate Mortgage Payment

 ConversionRate - Get Currency Exchange Rate

 GetQuote - Get Stock Quote

 getTime - Get the Current Time

 GetSunSetRiseTime - Get Sunrise and Sunset Time

 GetWeatherByZipCode - Get Weather by ZIP Code in US

 NDFDgenByDay - US Weather Forecast by Day

 NDFDgen - US-Weather Forecast for a Single Location

 questionSearch - Search Yahoo! Questions and Answers

 flickr.interestingness.getList - Get Interesting Photos

 Hotwire - Get Travel Ticker Deals

 Outdated Tutorials

 References

 PDF Printing Version