Pages

Thursday, 17 September 2020

API authentication methods automation with Rest Assured? API automation Interview questions for SDET SET-03

 
 
 
Check below link for question SET-01:
Top API Interview Question 1-10
 
Check below link for question SET-02:

   
    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?

Click here for answer 

  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.


Check below link for question SET-01:
Top API Interview Question 1-10
 
Check below link for question SET-02:
Top API Interview Question 11-20

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

Tuesday, 15 September 2020

Difference between API status code 401 and 403?

 


Check below link for question SET-01:
Top API Interview Question 1-10

The 401 (Unauthorized) status code indicates that the request not applied because it lacks valid authentication credentials for the target resource.
The 403 (Forbidden) status code indicates that the server understood the request but refuses to authorize it.


Frequent Cause
The 403 error can occur when a user able to login but don't have sufficient privileges to access the requested resource. For example, a normal user attempting to load an 'admin' route.
The most obvious time for 401 error, is when you have not logged in at all, or provided the incorrect password. If authentication credentials were provided in the request, the server considers them insufficient to  grant access.


Rare cause
403 errors can occur because of restrictions not entirely dependent on the logged in user's credentials.
401 errors can occur even if the user enters the correct credentials. This is rare, and might be something you only really encounter while developing your own authenticated back ends.
But if the authorization header is malformed it will return a 401

API Testing Interview Questions

Conclusion:
401 Unauthorized response should be utilized for missing or bad authentication, and  403 Forbidden response should be used afterwards, when the user is authenticated but isn’t authorized to perform the requested operation on the given resource.

 

Online training for API manual and automation testing batch will start from September 20th so contact @9619094122 to enroll.

 

*************************************************

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

 

Friday, 4 September 2020

Top 11 Kubernetes interview question and answers for SDET Devops QA SET-01?














Below is the list of Kubernetes interview questions on Pod, more will come in coming days so stay tuned and keep learning. Most asked k8s Interview Questions for DevOps in 2020.

As QA role in DevOps is quite vast so now it seems to be mandatory for Automation testers to learn Docker and Kubernetes. In fact in many interviews they are asking basic K8s commands.


1. How to create a Pod?
kubectl run <desired-pod-name> --image <Container-Image> --generator=run-pod/v1

2. How to get lists of all Pods?

kubectl get pods

3.
How to get list of pods which provide Node information of pods 
on which Pod is running?

kubectl get pods -o wide

4. How to get describe of Pod for troubleshooting?

kubectl describe pod <Pod-Name>

5. How to delete pod in Kubernetes?

kubectl delete pod <Pod-Name>

*What commands of GIT we need to know for DevOps and SDET?
 Click here for Answer

6. How to expose pod as service to access application from internet?

kubectl expose pod <Pod-Name> --type=NodePort --port=80 --name=<Service-Name>

7. How to get service information in Kubernetes?

kubectl get service

8.How to access the Pod logs?

kubectl logs <pod-name>

9. How to connect to a container in Pod and execute commands?

kubectl exec -it <pod-name> -- /bin/bash
ls cd /usr/....... cat test.html exit

# if you want to execute individual commands
kubectl exec -it my-first-pod ls
10. How to get YAML output of Pod and Service?

kubectl get pod my-first-pod -o yaml

11. How to delete a Pod?

kubectl delete pod <Pod name>
12. What are the Docker commands mostly asked in DevOps-SDET-QA interview?
Click for answer 
Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, for both declarative configuration and automation.  
Want to learn more? ...Check below link for more java interview question:
 

*************************************************

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