Designing a SoapUI Framework for SOAP based Web Services Automation

dom4j-1.6.1.jar, xmlbeans-2.6.0.jar
commons-collections4–4.1.jar, commons-collections4–4.1-javadoc.jar, poi-3.16.jar, poi-examples-3.16.jar, poi-excelant-3.16.jar, poi-ooxml-3.16.jar, poi-ooxml-schemas-3.16.jar, poi-scratchpad-3.16.jar, writeevidence.jar, xmlbeans-2.6.0.jar
keyStore- Keep All SSL certificates here.
output - Creates a folder for each run and store Request and Response of each test case from test data sheet.
projects - SOAPUIAutomationFramework will be there, which needs to be imported in SoapUI
sampleXML - sample xmls of Soap request will be created in this folder, which are used to create dynamic Soap Request
testData - SOAPUIAutomationFramework.xlsx will be there, which is source of test data
> createFolder
> bootstrap
> sampleXML
> pushSampleRequest
> testData
> requestSample
> transformXml
> pushFinalRequest
> WebServiceTest
> writeReq&Res
> statusWrite
> getNextStep
> End

Add WSDL in project

Add WSDL in project which has to be tested. User can add multiple WSDLs in one project, no need of creating multiple projects, testsuites or test cases.

Test Data/ Test Cases preparation

There will be only one test data excel sheet (same name as SoapUI project name, SOAPUIAutomationFramework.xlsx)There will be only one worksheet (same name as test case name in SoapUI, WebServiceTest). Following columns are there in test data sheet.

  • WebService — enter Web Service name, exactly same from SoapUI
  • Operation — enter operation name, exactly same from SoapUI
  • EndPoint — enter end point of web service
  • UserName — enter user name if user authentication is requied.
  • Password — enter corresponding password for the given username
  • KeyStore — This is for SSL certificates. Copy your certificate in keyStore folder, and enter the name of the same in this column
  • KeyPass — enter password of KeyStore certificate
  • Env — Enter environment Name
  • Test Case — enter test case name/description
  • Data1 to Data…n — These are the test data for soap request. User needs to provide data in the form of “KEY,VALUE”. Where key is text node name and value is text/string which user wants to pass in it
  • Expected1 to Expected…n — These are the validations with soap response. User needs to provide data in the form of “KEY,VALUE”. Where key is node name and value is text/string which user wants to validate to pass or fail the test
  • Status — This column will be filled after the test run. Values will be PASSED, FAILED and empty(if Execute is N)
  • Data and Expected columns accept direct node name, xpath, list node (need to provide with indexing)
  • ‘#KEEP’ is a keyword, if user wants to keep the text node in soap request with empty/null value. e.g ‘username;#KEEP’ . in this scenario username will be part of Soap Request but with empty value.
  • ‘#EXISTS’ is a keyword, if user wants to validate a dynamic value in Soap Response. e.g. ‘transactionNumber;#EXISTS’. In this scenario system checks if provided node is present in Response or not and it should not be empty.

Running the tests

You can run the test directly from SoapUI, create a .bat file and create a Task scheduler in windows or .sh file and write a cron job in ubuntu machine.

Stats

This framework can execute 600 test cases in 1 hour, or even more based on your system tps.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store