SOAP UI is a free, open source cross-platform functional Testing solution. It enables you to rapidly and easily create and execute automated regression, compliance, functional and load tests. Its used for Web Services Testing.
Web services are a medium through which web based application can be integrated or communicated over an internet protocol backbone. Web based application can be integrated using XML, SOAP, UDDI and WSDL. SOAP is used for transmitting the data; WSDL is used for describing or relating the services, UDDI is used for listing what services are accessible, XML is used to tag the data.
SoapUI can-
1. It can do automated testing like load tests, scenario-based tests and data driven tests
2. It has got built-in reporting abilities
3. It has got unique ability to impersonate Web services and run functional and load test against them even before they are executed
SOAP UI uses three levels to structure functional tests
* TestSuite: It is a pool of test cases used for combining functional tests into logical units.
* TestCase: It is a group of test steps that are bring together to test some specific aspect of your services. * * You can augment any number of testcases to test suites
* TestSteps: They are “building blocks†of functional tests in SOAPUI. They together makes TestCase and determines the flow of execution of the service to be tested
* SOAP: Soap stands for Simple Object Access Protocol and it is a protocol used for receiving and sending data over HTTP as XML.
* REST: It is a way of designing a web services.
There are four components are used in web services. They are,
1. WSDL – Web Service Description Language
2. SOAP – Simple Access Object Protocol
3. UDDI – Universal Description, Discovery and Integration
4. RDF – Resource Description Framework
5. XML – eXtensible Markup Language
Properties in SOAPUI is used to retrieve and store data. The data is stored as key, value or format.
We can read the property values into test step endpoint, username, header values, password, domain, POST, PUT, GET and DELETE method properties.
SOAP UI supports two language, Groovy, and JavaScript.
By default, SOAPUI has properties at three levels
* Project level default or custom properties: User can append any number of properties at project level and it can be opened from any test steps from any test cases under any test suites
* Test suite level default or custom properties: User can append any number properties at test suite level and it can be used from any test steps from any test cases under this test suite
* Test case level default or custom properties: At Test Case level users can add any number properties at test case level and it can be used from any test steps from this test case
To parameterize the endpoints in SOAP UI is most important as it is the first step in Automation Testing. It is more time consuming for changing endpoints manually. In order to do that
* Define a project property holding the endpoint
* Change the endpoint to use this property via property expansion
* Ensure that your requests are availing the configured endpoint
* When a request is run, the property will inevitably be with its current value. To use a different value just configure the endpoint in the UI, you can use the P option from the command line
It is used to declare the web service reply by giving the complete path. If this path is matching with the answer, the test case will be measured as PASS else; it will be knowledgeable as FAILED. We can observe the outcomes of the declaration at the end of the supervise, and the Assertion tab has resulting information there.
Authenticating web services is probable with WSDL because to systematize web services in SoapUI, only WSDL text is obligatory. If the WSDL text is not legal, SoapUI will throw an exemption directly.
To perform functional testing for web services, we can use the following tools.
* SoapUI
* RESTClient – This is a Firefox plug-in
* JMeter – Specially made it for performance testing tool and also we can do functional testing the web services.
Validating web services in only possible with WSDL document because to configure web services in SoapUI, WSDL document is mandatory. If the WSDL document is not valid, SoapUI will throw an exception immediately.
Universal Description, Discovery and Integration- a directory or global repository where all the web services can be found. A new Webservice can also be registered through this. This is also the place where WSDL detailed definitions are found.
Simple Object access protocol that uses XML to interact with web applications. It uses XML based content to communicate between two client machines across any network.
Since its XML based, it is platform and programming language independent. RPC (Remote procedure calls) are sometimes blocked by firewalls and proxy servers- Soap overcomes that.
Envelope element is the topmost tag which identifies the XML document as a SOAP message. Followed by Envelope element, you see the header element that has header information. The Body element specifies the call and response information. Finally, you have a Fault element which contains errors and status information.
A protocol is a set of standard rules that help to communicate the hardware devices through the software applications. There are different types of protocols used in the Internet and Intranet applications. They are
TCP which stands for Transmission Control Protocol. It has the rules to exchange the messages between two different Internet applications.
Internet Protocol uses the rules for sending and receiving the information between two different Internet addresses.
Similarly, HTTP, FTP and DHCP protocols have used the set of rules to transfer the data other than Internet applications.
* SoapUI offers us to perform automation testing which includes functional testing, load testing and Data Driven testing.
* It also provides in build reporting tool and export test results log provision.
* We assert our services using various types of assertions.
In a SoapUI project, the following order should be maintained.
* TestSuite – This is combination of functional tests and logical blocks
* Testcase – It’s a group that contains several test steps for the specific aspects of the service.
* Teststep – it contains the set of functional tests
* Create a project and add the WSDL file
* Add test suites, Test cases and Test cases- in that order
* Include custom programming/validation using by adding Groovy steps
* Call external data sources if using
* Add assertions if necessary
* Then RUN.
Assertions compare the parts/all of the response message to the expected outcome.
To write test scripts 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 at the project level in the project details tab at the bottom left.
In SoapUI, XPath assertion is used for asserting the web service response value by specifying the absolute path. If the absolute path is matched with the response value, then the test case or test suite will be considered as PASS otherwise it will be notified as FAILED. We can see the results of assertion at bottom of the screen where the Assertion tab will have resultant information.
Data Driven testing means to store our test data which includes input and expected output in an external data source called Excel / Database / XML file. Later, we need to iterate the data source using respective component. In SoapUI, Datasource and Datasource Loop test steps are used for performing data driven testing.
Groovy is a scripting language which internally includes all the Java libraries – it helps us to customize and add custom validations to SoapUI tests
Yes -Groovy steps and Javascript steps.
The basic Test suite is a way for us to group tests in SoapUI. When you need a different set of tests, you just have to create a new test suite and create tests as required under it as test cases.
The response values can be saved by clicking on the required request and choosing the “Dump file†location in its properties.
To create test suite in soapui -
* either from project popup menu ("New TestSuite") or
* with specific button on top of the list of TestSuites
To run multiple test cases in soapui, options are as -
Option 1 - skip the -c argument to execute all test cases in the suite
-c: Specifies the test case to be run.
Option 2 - run testrunner.bat as a separate command for each test case
testrunner.bat -sTESTSUITE -cTESTCASE2
To automate rest web services using soapui, steps are as
SOAPUI tool - testunner.sh/bat, is used for suites and test cases execution and report generation. Open testrunner dialog in your project and then select Launch TestRunner by right click menu.
After which, configure TestRunner path in Basic tab and the outputs in Reports tab, the next step click on Launch button and the tests will be executed by testrunner.
Next, integrate your project with jenkins, by an xml file (build.xml) that will be used in an ant call.
Lastly, create a job in jenkins, providing the Name and Description for the project.
The difference between soapui and postman -
SoapUI – Can test REST and SOAP APIs. It is built for API testing. Java based API testing tool
Postman - It is a Google Chrome plugin. used for API testing. Can test web services.
To perform functional testing for web services, we can use the following tools.
* SoapUI
* RESTClient – This is a Firefox plug-in
* JMeter – Specially made it for performance testing tool and also we can do functional testing the web services.
Since its XML based, it is platform and programming language independent. RPC (Remote procedure calls) are sometimes blocked by firewalls and proxy servers- Soap overcomes that.
To set property value in soapui using groovy script -
Right-click on the Test steps node
Click the Add Step option and Properties option from context menu
Enter the property name as desired and click OK
In the properties screen, click properties with groovy Script(1) icon to add property
Enter your desired property name and click OK button.
Type any default value for the property if you wish.
After which, Groovy Script test step is to be added next to property step.
It is when you hoard test data, i.e. input and predictable output, in some external storage such as database or spreadsheet, etc. and then employ it iteratively in tests while administration them.
It is XML based and is the stand as well as encoding language independent. Substitute servers and firewalls infrequently block remote process calls or RPC. Soap is used to conquer that.
Envelope element is the top most tag which identifies the XML document as a SOAP message. Followed by Envelope element, you see the header element that has header information. The Body element specifies the call and response information. Finally, you have a Fault element which contains errors and status information.
A protocol is a set of standard rules that helps to communicate the hardware devices through the software applications. There are different types of protocols used in the Internet and Intranet applications. They are
TCP which stands for Transmission Control Protocol. It has the rules to exchange the messages between two different Internet applications.
Internet Protocol uses the rules for sending and receiving the information between two different Internet addresses.
Similarly, HTTP, FTP and DHCP protocols are used the set of rules to transfer the data other than Internet applications.
WSDL (Web Services Description Language) is the standard format for describing a web service. It is written in XML.
SoapUI is a webservices testing tool and SoapUI Pro is its commercial version. SoapUI can help create functional, security and load testing test suites. SoapUI Pro does all that with advanced drag and drop, data driven testing, advanced reporting and coverage analysis.
* SoapUI offers us to perform automation testing which includes functional testing, load testing and data driven testing.
* It also provides in build reporting tool and export test results log provision.
* We assert our services using various types of assertions.
Envelope constituent is the peak most tag which identifies the XML text as a SOAP message. Followed by Envelope constituent, you see the subtitle element that has slogan information. The Body constituent specifies the call and replies to information. Finally, you have a Fault constituent which contains errors and status information.
Log pane stores the transaction-related information between the client and the server. The most commonly used log panes in SOAP UI are Soapui Log, HTTP Log, Error Log, and Memory Log.
The JDBC Status assertion validates the execution of the JDBC request of the target TestStep.
The types of performance testing include Baseline testing, Load testing, Soak testing, and Scalability testing.
The RESTful Web Services are the ones, which are based on REST architecture. They implement the REST architecture using HTTP methods.