https://www.guru99.com/api-testing.html
All Web Services are API but APIs are not Web Services.
Api Testing is entirely different from GUI Testing and mainly concentrates on the business logic layer of the software architecture. This testing won't concentrate on the look and feel of an application.
Instead of using standard user inputs(keyboard) and outputs, in Api Testing, you use software to send calls to the API, get output, and note down the system's response.
https://www.linkedin.com/pulse/difference-between-api-testing-unit-mj-alavi
https://www.youtube.com/watch?v=0pcM6teVdKk&list=PL6n9fhu94yhW7yoUOGNOfHurUE6bpOO2b
References:
All Web Services are API but APIs are not Web Services.
Api Testing is entirely different from GUI Testing and mainly concentrates on the business logic layer of the software architecture. This testing won't concentrate on the look and feel of an application.
Instead of using standard user inputs(keyboard) and outputs, in Api Testing, you use software to send calls to the API, get output, and note down the system's response.
Difference between API testing and Unit testing
Unit Testing | API testing |
---|---|
|
|
Tools for API testing
Since API and Unit Testing both target source code, similar tools can be used for testing both.
- SOAPUI - It's an easy-to-use tool with extensive REST and SOAP API testing capabilities – no scripting experience is required.
- Runscope
- Postman with jetpacks
- Postman with Newman
https://www.linkedin.com/pulse/difference-between-api-testing-unit-mj-alavi
https://www.youtube.com/watch?v=0pcM6teVdKk&list=PL6n9fhu94yhW7yoUOGNOfHurUE6bpOO2b
References:
- https://www.soapui.org/
- https://www.soapui.org/tutorials.html
http://techonestop.com/soapui-alternative-for-webservice-testing - https://www.youtube.com/watch?v=Op6XpK9VJn4&list=PL_SsnJZ0TQhaTWws490iAxZby6Lwf7tFX
Web Service can be called by a Software Application using SOAP or HTTP protocol.
Web Services can be implemented in different ways, but the following two are the popular implementations approaches.
- SOAP (Simple Object Access Protocol)
- REST (Representational State Transfer architecture)
SOAP uses the XML format to send and receive the request
REST is an alternative to SOAP. Rest API supports both XML and JSON format. It is usually preferred for Mobile and web apps as it makes app work faster and smoother
SOAPUI is used to test the web service, it also used for functional testing also.
XML: Extended Markup Language
In html we need to use predefined set of tags Ex: <input /> <p> <h1> <body>
In XML we can set our user defined tags.
<booking>
<name> </name>
<location> </location>
<FromDate> </FromDate>
<ToDate> </ToDate>
</booking>
SOAP is a protocol which use xml format. This protocol used to pass data from one application to another application.
Install SOAP:
https://www.soapui.org/ this software is from smartbear corp.
There are 2 version of the SOAPUI
- SoapUi (Free)
- SOAP Pro - Licensed (Trail for 14 days)
Prerequisite
Java install.
Download and Install with default options.
Open application
It will ask for survey, we can ignore it for the moment.
Now the Home page will be opened.
WSDL: Web service description language
An WSDL document describes a web service.
More on WSDL: https://www.w3schools.com/xml/xml_wsdl.asp
Now we require to get some free web service for testing. Lets take the example of currency convertor.
Copy WSDL :
Open SoapUI:
In Initial WSDL field enter the WSDL location. The Project Name is auto picked from WSDL and also you can change to any name.
Click on OK.
Under Project we can see CurrencyConvertor → ConversionRate → Request1
Double click on Request1 to see the right panel. Its has two sections Raw and XML. Now, we need to Convert the value from us dollar to indian rupees.
So we need to add parameters in FromCurrency and ToCurrency tags.
Change the values as highlighted
- FromCurrency USD and ToCurrency INR
- Click on Execute
- Check response – Conversion value.
Assertion in SOAPUI:
For this am using the following WSDL location:
Click on OK
- Click on + (Add Assertion) button
- Select Assertion type : here am selecting string contains type.
- Click on Add button
No comments:
Post a Comment