8257 interfacing 2 in microprocessor for btech students
Deep dive into SoapUI
1. Deep dive into SoapUI
Andrii Olieinik
Senior QA Automation Engineer
2. About me
• Senior QA Automation Engineer
• About 10 years of work in Quality Assurance area
• DataArt IT school in Odessa and Lublin
• PhD, Theoretical physics
2
4. SoapUI
4
SoapUI is an open-source web service testing
application for service-oriented
architectures(SOA) and representational state
transfers (REST).
SoapUI was developed by Eviware software. In
2011, SmartBear Software acquired Eviware.
10. SoapUI
• REST requests
• SOAP requests
• Tests
• Test suits
• Scripts
• Variables
• Execute from command line
• Integration with CI
• Integration with Maven
• JUnit reports
• Web Service Mocking 10
13. More details
• Postman docs: https://www.getpostman.com/docs/
• Scripts in Postman: https://www.getpostman.com/docs/postman/scripts/intro_to_scripts
• Newman: https://github.com/postmanlabs/newman
• SoapUI: https://www.soapui.org/downloads/soapui/alternate-platforms.html
• Your First SoapUI Project: https://www.soapui.org/getting-started/your-first-soapui-project.html
• Structuring and Running Tests (SoapUI): https://www.soapui.org/Functional-Testing/structuring-
and-running-tests.html
• Getting Started with REST Testing in SoapUI: https://www.soapui.org/rest-testing/getting-
started.html
13
14. REST examples
• JSON Placeholder fake API: https://jsonplaceholder.typicode.com/
• National Digital Forecast Database (NDFD) REST Web Service:
http://graphical.weather.gov/xml/rest.php
• National Bank of Ukraine: http://www.bank.gov.ua/control/en/publish/article?art_id=25365630
• Narodowy Bank Polski: http://api.nbp.pl/en.html
14
15. WSDL examples
• ISBN Test: http://webservices.daehosting.com/services/isbnservice.wso?WSDL
• Country Information:
http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL
• Number Conversion:
http://www.dataaccess.com/webservicesserver/numberconversion.wso?WSDL
• Bankleitzahlen Service: http://www.thomas-bayer.com/axis2/services/BLZService?wsdl
• National Digital Forecast Database (NDFD) SOAP Web Service: http://graphical.weather.gov/xml/
15
19. Properties Transfer
• Transferring Property Values: https://www.soapui.org/functional-testing/properties/transferring-
properties.html
19
20. Property Expansion
• ${#Scope#Property-name[#xpath-expression]}
• ${#Project#Property-name}refers to a Project Property
• ${#TestSuite#Property-name} refers to a TestSuite Property
• ${#TestCase#Property-name} refers to a TestCase Property
• ${TestStep-name#Property-name} refers to a property in a named TestStep.
20
21. Assertions (Property Content)
• Contains
• Not Contains
• JsonPath Count
• JsonPath Existance Match
• JsonPath Match
• JsonPath RegEx Match
• XPath Match
• XQuery Math
21
43. TestRunner (options)
• ..SoapUI-5.4.0bintestrunner.bat
• testrunner.bat -s"TestSuite 1" -r -j D:REST-Project-1-soapui-project.xml -f D:SoapUI-5.4.0report
• a : Turns on exporting of all test results, not only errors
• c : The TestCase to run, used to narrow down the tests to run
• e : The endpoint to use when invoking test-requests, overrides the endpoint set in the project file
• f : Specifies the root folder to which test results should be exported
• j : Turns on exporting of JUnit-compatible reports, see below
• P : Sets project property with name=value, e.g. -Pendpoint=Value1 -PsomeOtherProperty=value2
• s : The TestSuite to run, used to narrow down the tests to run
43
44. SoapUI logs
• By default in ..SoapUI-5.4.0bin
• soapui-log4j.xml
• soapui.log
• soapui-errors.log
• global-groovy.log
44
45. Authorization
• Steps to run Twitter API with SoapUI: http://acodediary.com/twitter-api-with-soapui/
45
54. Integration with Maven (extensions)
• Put additional jars into ext folder
• Or add new module to the project
54
55. Listeners
• Create my-listeners.xml file in SoapUI-5.2.1binlisteners
• Create MyListener.java, compile it in jar file and put in SoapUI-5.2.1binext
• Create a directory build
• Run java compilation from the command line:
• javac -cp soapui-5.2.1.jar com/dataart/api/listeners/MyListener.java -d ./build
• Go to the build folder (cd build) and create a jar
• jar cvf YourJar.jar *
55
60. More details
• Custom report: https://github.com/a-oleynik/SoapUI/blob/master/CustomReport.groovy
• Maven project with SoapUI example: https://github.com/a-oleynik/SoapUI/tree/master/api-test
• Listener code example: https://github.com/a-oleynik/SoapUI/tree/master/Listener
60
61. Possible task
• Create custom report into an xml file.
• Create a Data Driven test and read data from excel file.
• Create a Maven project for your SoapUI project. Set the project up and execute it from the
command line.
61