API
What is the first thing you check once you get a response?
Check the status code to get 200 = OKAY and not 404 = Not Found
What. is XML?
Extensive Markup Language(XML) -Defines a set of rules for encoding documents in a format that is both human-readable and machine-readable
What are HTTP Requests and HTTP Responses?
HTTP Requests- -Request method: Get,Post,Put,Delete -Request URI: The URL of the resource -Request Header:Accept-Language, Accept-Encoding,Host -Request Body: This is data to be sent to resource HTTP Response- -Response Status Codes: 200,301,404,500 -Response Header: Date,Server,Last Modified,Content-Type -Response Body-Data that comes back to the client from server
What is hamcrest matcher for?
Hamcrest is a framework for writing matcher objects allowing 'match' rules to be defined declaratively.
What Web Services do you use in your project?
I use RESTful which is respresentational state of trasnder and it communicates with XML and JSON, but my current project uses JSON
Headers in REST API?
I use accept type. It checks what I am receiving and it should be in JSON or XML format And content type. It checks what I am sending should be in JSON format
What methods are you using to verify the size of response data?
I use matches from Hamcrest -hasitems() -equalTo()
Can all API endpoints use all of the HTTP Protocols?
It depends, my API developer decides if that URL works with GET,POST,PUT, or DELETE requests.
SOAP vs Rest web services?
REST supports JSON, XML, TEXT; whereas SOAP only supports XML Rest is faster than SOAP based web services
Specific API's
REST-a collection of guidelines for lightweight, scalable web APIs. SOAP-a stricter protocol for more secure APIs. RPC-a protocol for invoking processes that can be written with XML (XML-RPC) or JSON (JSON-RPC).
What is SOAPUI? how did you use it in your current project?
SOAPUI is the leading open source cross-platform API testing tool SOAPUI allows me to execute. automated functional, regression, compliance, and load tests on different web API
Do you use any non-web service API?
Selenium API for browsers JDBC for database RESTAssured library for API
Serialization vs Deserialization?
Serialization- when we MAP a Java object to an API JSON format. Java Object -> MAP it to API JSON/XML Deserialization-is viceversa. We get the API JSON and MAP it to the Java Object
How and where are you sending requests?
Since I am using REST, it has endpoints. My developers create public urls and requests are sent to that url
What is JSON?
-JavaScript object Notation -Primarily used to transmit data between s server and web application, alternative to XML -Lightweight version of XML
Advantages of using REST?
-REST allows greater variety of data formats -Considered easier to work with -better support for browser clients -faster and less bandwidth -easier to integrate with existing websites with no need to refactor site infrastructure
RESTful web service/API
-Rest stands for Representational State Transfer -RESTful is referred for web servoces written by applying REST architectural concepts -In RESTful, web service http method like GET,POSTMPUT, and DELETE, can be used to perform CRUD(Create>Read>Update>Delete) operations
How do you test REST API?
-Verify if REST API endpoint is working as expected -Postman and RESTAssured library in Java -I use request types and verify response status code and response body and header -I also do positive and negative testing of API
How do you verify a value in response body?
1)Hamster matcher in assertion library. Parse into JSONPath and use getint(), getString(),getList() methods to read ID value. Use JUnit Assertion 2)Deserialization to a (POJO) or object . Use JUNIT assertion
API parameters
1)Path parameter(value will be part of URL) Query/Requests 2)Parameters(Keys+Value Format)
HTML Status code?
1XX-Informational 2XX-Success. 200=OK 201=Created 202=Accepted 204=No Comment 3XX-Redirection 4XX-Client Error. 400=Bad Request 401=Unauthorized 403=Forbidden 404=Not Found 405=Method Not Allowed 5XX-Server Error. 500=Internal Server Error 501=Not Implemented 502=Bad Gateway 503=Service Unavailable
API
An application programming interface is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software
What is JsonPath?
Another way to validate response body JsonPath j = response.jsonpath;
How do you test API in your project?
As a tester, we send an API request and verify the status code, response body and check the endpoints of the API URL so it is working as expected.
Authorization vs Authentication?
Authentication is who you are. User & Pass Authorization is what rights you have. Different types
What are some types of Requests in REST API?
include GET,POST,PUT, and DELETE requests. GET: reads data POST: creates data PUT: updates data DELETE: delete data
What is the RESTAssured library?
is a non-web service API that is BDD format and helps integrate JAVA code using deserialization and serialization to extract data from JSON and transform it to Java object in order to store, verify, and validate the data to the expected one.
What is Backend APi? How do you test?
is where application logic code is. 2 ways to test 1)Manually-By using tools such as Postman, and sending requests and verifying response 2)Automated-By using Java and RESTAssured library
Commonly used HTTP methods in REST based architeture?
POST-sends data to server GET-retrieves data from given server using given url PUT-replaces all current representations of target resource with the uploaded content DELETE-removes all current representations of target resource given by url
Tools for API testing?
Postman RESTAssured library
What is URI? The Purpose and format for URI
URI stands for uniform resource identifier purpose of uri is to locate a resource on the server hosting the web service uri format is <protocol>://<service-name>/<resource type>/<resource ID>
