What is an API?
API ⇒ Application Programming Interface.
API is the middle layer that is between the application User Interface and Database.
API handles data transfer between UI to Database and vice versa.
What are the differences between REST and SOAP?
SOAP ⇒ Simple Object Access Protocol.
* Only works with XML.
* Only has 1 HTTP method as ‘POST’.
* WSDL (web services description language) provides detailed information about the SOAP services.
* Envelope structure. (message to server)
* UDDI registry.
REST ⇒ REpresentational State Transfer.
* Accepts multiple data transfer methods: GET, POST, PUT, PATCH, DELETE.
* Faster performance.
* More flexible.
* Set of architectural guidelines.
What is the difference between an API and a Webservice?
All Webservices are API’s that use the internet. (using HTTP protocol)
There are API’s that do not use the internet and they are just called API’s.
Example of API that does not use the internet:
The Windows API is a collection of functions and routines that allow software applications to interact with the Windows operating system. It doesn’t rely on internet connectivity and is used for various tasks such as file operations, user interface interactions, and system management.
What do you validate when you are testing an API?
What are tools that can be used to perform API testing?
Manual:
* Postman
* Ready API
* SoapUI
Automation:
* Rest Assured library
What are the key differences between API and UI testing?
When we test the User interface of the application we can clearly see whether our test has passed or failed since User interface is visible.
API requests will travel to the server, the server will process the request, however the result of the request can only been seen within the API response body.
Can you automate API testing, if so how?
There are many libraries that allow API automation testing.
I began automating API’s using POSTMAN with JavaScript. Currently, I am using REST Assured library with JAVA to automate API’s.
What is URI?
URI ⇒ Uniform Resource Identifier — is a sequence of characters that distinguishes one resource from another. In the API it is the endpoint that is considered URI.
What are the REST API HTTP methods you are familiar with?
What is meant by Client and Server?
Can you provide a basic flow of an API Request/Response?
Client ⇒ Any device that submits the triggers the API requests.
Server ⇒ A server that process API requests.
|
What are the main differences between XML and JSON?
XML ⇒ Bulky uses tag based structure, more secure, lower performance.
JSON ⇒ Data structure, faster performance, lower security.
What is HTTP protocol?
What is HTTPS protocol?
HTTP ⇒ HyperText Transfer Protocol.
HTTPS ⇒ HyperText Transfer Protocol Secured.
What are request Headers?
Can you provide an example?
Are Headers always required?
Headers provide extra information to the server in order to process the request.
Content-type ⇒ Application/Json
Authorization ⇒ Token
Depends on the configuration of the API whether headers are mandatory or not.
If you had to make a REST request what is the information you need?
Can you explain how this Web service works?
A web service typically works:
What should I expect if the Webservice is successful vs. unsuccessful?
When a Webservice call is Successful, you can expect:
When a Webservice call is UNsuccessful, you can expect:
RESUME: Overall, successful web service interactions should result in the desired outcome as specified by the service’s functionality, while unsuccessful interactions should provide meaningful error information to help diagnose and resolve issues.
What are the different ways API requirements are communicated to you?
What are the parameters you have heard of with REST Webservices?
What is your step by step process to testing a REST Webservice ?
Step 1: I will review the API requirments in documentation to get familiar with the API’s details and understand its purpose within in the application.
Step 2: I will plan Test Cases based on reviewing the Acceptance Criteria.
Step 3: I document my Test Cases in my test management tool JIRA X-Ray.
Step 4: I create all my API tests in POSTMAN and execute them from my collection.
Step 5: For each API test case I check and verify the following:
* Data accuracy: I check the request and response body whether those are as written on API documentation in terms of data type and data structure.
* HTTP status code: For example, creating a resource should return 201 CREATED and unpermitted requests should return 403 FORBIDDEN, etc.
* Response headers: HTTP server headers have implications on both security and performance.
* Response body: Check valid JSON body and correct field names, types, and values - including in error responses.
* Authorization checks: Check authentication and authorization.
* Error messages: Check the error code coverage in case API returns any error.
* Response time: Implementation of response timeout.
Step 6: If there are any bugs I will work with my development team on ensuring timely fixes.
How do you test REST API?
I also do a Positive and Negative testing of API.
Steps for Positive testing:
* Sending valid request parameters,
* Sending valid headers,
* Sending valid request JSON body,
* … and Verify that response status code IS EQUAL 200 - Successful and JSON response body data is also matching the expected data.
Steps for Negative testing:
* Sending invalid request parameters,
* or Sending invalid headers,
* or Sending invalid request JSON body,
* … and Verify that response status code IS NOT a 200 - Successful and JSON response body data contains ERROR message.
Have you heard of JSON Path?
JSON Path is a query language that allows you to navigate and query JSON (JavaScript Object Notation) data structures.
What is the Objective of API testing?
ANSWER #1:
API testing involves APIs directly and checks whether the API meets expectations in terms of functionality, reliability, performance, and security of an application. My first concern is functional testing which ensures that the API functions correctly.
|
ANSWER #2:
The main objectives in functional testing of the API are:
* To ensure that the implementation is working correctly as expected - no bugs!
* To ensure that the implementation is working as specified according to API documentation.
* To prevent bugs between code merges and releases.
What is the difference between API Authorization and Authentication?
Authentication - is the process of verifying the identity of a user, system, or entity.
Authorization - is the process of determining what actions or resources a user, system, or entity is allowed to access or perform after successful authentication.
What type of API Authentication / Authorization security protocols are you familiar with?
Yes, I am familiar with the following: