API/WebService Adaptor example
Description
Through the API/WebService Adaptor, H-TEST connects with API REST services that are available in an End Point and use them for testing. This adaptor has an important companion named Web Services Mapping Assistant with a more detailed and complex user interface for helping to the creation of TAST messages and mappings. It’s possible to perform single tests with this adaptor or End to end tests connecting with other adaptors either.
Statement of the exercise
Solving the test case
As a part of the mapping process, you should provide the adaptor’s information, regarding to connect and use it.
-
EndPoint: base URL to access the service: https://www.httpbin.org/
-
Keep Session: indicates whether the session should be maintained between requests to the service. If it is checked, the adapter will add the cookies it receives in the responses to the requests it makes.
-
IsSecure: indicates if requests to the service were sent over the http or https protocol.
-
Headers: allows adding headers to all the requests that are sent to the service.
-
Authentication Type: allows selecting the type of authentication that the service requires.
Functions we have used with HTMLAPI/Webservice GUI Adaptor:
- getTest
- postRest
- deleteRest
- putRest
- getHeaderValue
- getXMLElementByXpath
- getXMLElementValueByTagName
- GetResponseStatus
Test Set Execution
When we finish executing this test case, we see if it has been executed correctly:
Capture of results
We then open the icon on the right (marked with a red arrow) and we have as a result the evidence folder, where both the log of the execution is stored, as well as all the screenshots, files, etc... if we have checked the "Evidence" box in the general settings of the diagram.
