Top API Interview Question 1-10
21. How to use Basic authentication in automation?
Response resp = given()
.auth()
.basic("sid", "sid").when().get("https://reqres.in/api/users/2");
22. How to use Pre-emptive authentication in automation?
Response resp1 = given()
.auth()
.preemptive().basic("sid", "sid").when().get("https://reqres.in/api/users/2");
23. How to use digest authentication in automation?
Response resp2 = given()
.auth()
.digest("sid", "sid").when().get("https://reqres.in/api/users/2");
24. How to use Oauth2 authentication in automation?
Response resp3 = given()
.auth()
.oauth2("").when().get("https://reqres.in/api/users/2");
25. How to use Oauth authentication in automation?
Response resp4 = given()
.auth()
.oauth("consumerKey", "consumerSecret", "accessToken", "secretToken").when().get("https://reqres.in/api/users/2");
26. How to use header for authorization(oauth2) in automation?
Response resp5 = given().header("Authorization","accessToken")
.when().get("https://reqres.in/api/users/2");
}
27. How to automate GET method using Rest Assured?
28. Difference between status code 401 and 403?
Click here for answer 401 vs 403
29. What are main differences between API and Web Service?
- All Web services are APIs but not all APIs are Web services.
- Web service uses three styles of use: SOAP, REST and XML-RPC for communication whereas API may be exposed in multiple ways.
- Web service needs a network to operate but APIs don’t need a network to operate.
30. What is REST?
- REST (Representational State Transfer) is an architectural style for developing web services which exploit the ubiquity of HTTP protocol and uses HTTP method to define actions. It revolves around resource where every component being a resource that can be accessed through a shared interface using standard HTTP methods.
- In REST architecture, REST Server provides access to resources and client accesses and makes these resources available.
- Each resource is identified by URIs or global IDs, and REST uses multiple ways to represent a resource, such as text, JSON, and XML.
Top API Interview Question 1-10
Online training for API manual and automation testing batch will start from September 28th so contact @9619094122 to enroll.Demo for API online training is on 24th 7:30 PM IST
*************************************************
API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign
Java Related Interview Question Set
https://automationreinvented.blogspot.com/search/label/Java
GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT
Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
No comments:
Post a Comment