
In this lecture, we will learn '
Set up a maven project in Eclipse, add rest-assured and JUnit dependencies in pom.xml, and configure a Java version compatible with REST API testing.
Learn to build and send HTTP requests with rest assured, using given/when/then or given/expect/when styles to set parameters, headers, and body, and validate responses.
Learn how to statically import Rest Assured methods to simplify test code using given, when, and then without the class prefix. The refactor ensures tests pass with static imports.
Learn to pass query parameters in rest assured GET requests to filter students by program and limit results, using query params, params, and a map of parameters.
Create a student pojo, serialize it to json with rest assured, add a Jackson or Gson serializer in maven, and post the payload to create the student.
Learn to log request information with REST Assured, including the request body, headers, and all details, and apply conditional logging that outputs only when tests fail.
Learn to log response information in Rest Assured by printing headers, status line, and body. Use the log method after then, and conditionally log on errors.
Set up the open source Best Buy API playground locally, explore a realistic data set with 50,000+ products, and perform CRUD via swagger and a postman collection.
Here's a step-by-step instruction guide on how to find the Docker image of Best Buy API Playground and what you need to do on your local machine if Docker is already installed:
Find the Docker Image
Open your web browser and navigate to https://hub.docker.com/r/tejasn1/best-buy-api-playground.
Here, you will find the Docker image tejasn1/best-buy-api-playground. This is the Docker image that we will be using.
Pull the Docker Image
Open your terminal.
Use the Docker pull command to download the image: docker pull tejasn1/best-buy-api-playground:latest. The latest tag downloads the most recent version of the image.
Run the Docker Image
Once the image is pulled, you can run the Docker image on your machine. If you want to run the Docker container on a different port, such as 8085, you can do so with the following command: docker run -p 8085:3030 -d tejasn1/best-buy-api-playground:latest.
This command tells Docker to run the image in a new container, map the host's port 8085 to the container's port 3030, and run the container in the background.
Access the Best Buy API Playground
After starting the Docker container, the Best Buy API Playground application will be accessible at http://localhost:8085 on your machine.
Learn to extract values from a json response using the Java JsonPath library by converting the response to a string, then apply JsonPath expressions to root element and print results.
Extract response values with JsonPath(JsonSlurper) in Rest Assured, retrieving total, first store name, first service name, and the store with zip 55901 using the BestBuy stores endpoint.
Learn to extract values from API responses using jsonpath with JsonSlurper, including getting store addresses by zip, max/min ID stores, and listing service names from nested data.
Learn to extract values from json and xml responses in rest assured using json path and xml path, demonstrated with the walmart search api and api key setup.
Learn how to extract data from XML responses using XML path in rest assured, with hands-on examples for number of items, first product name, and gift options.
Learn to extract data from API responses with XMLPath in REST Assured, counting item nodes, retrieving product names, and locating sale prices via deep search with star star.
Learn how to add assertions directly in Rest Assured responses using jsonpath, hamcrest matchers, and JUnit assertions, including testing integers, strings, and lists.
Learn how to use soft assertions in Rest Assured to check multiple fields without halting tests, contrasting hard assertions that stop at the first failure.
Learn how to use root paths in rest assured to simplify jsonpath assertions, set shared roots, and reuse paths across tests, with examples validating rate, name, id, and count.
**COMPLETE GUIDE FOR REST ASSURED WITH REAL-WORLD API'S, THROUGH COVERAGE ON FRAMEWORK DEVELOPMENT**
In the 21st century, almost all web applications use web services to communicate or interact with each other. Most modern-day web services are built on Representational state transfer (REST) architecture; REST has gained a lot of popularity and it will continue to do the same due to its simplicity in comparison with other technologies.
It is very important for software QA engineers, automation engineers, and software developers to understand the importance of Web Services testing and more importantly how to automate these tests. Automating Application Program Interface (API) tests are critical and crucial for most projects due to the fact that API tests are far more stable, reliable and fast.
In this course, you will be provided with the tools and techniques needed to be successful with REST API automation. We will be focusing on the important topics listed below:
Introduction to REST Assured, which is a popular open-source library used for API test automation. Learn to write tests for GET, POST, PUT, PATCH and DELETE operations using a sample application provided in the course
Understand and use JSONPath, XML Path (with Groovy syntax) to assert and extract the response
Simplify writing JSONPath by using Root path feature
Practical examples demonstrating different Rest Assured topics (Request Specification, Response Specification, Logging, Parameters, File Download etc.)
Logging Request and Response information based on test status
Avoiding writing repetitive code by using Request/Response specification concepts
Adding multiple assertions to a single test
Soft Assertions in Rest Assured
File Download
File Upload using the multipart method
Work with real-world examples such as Walmart Search API, PayPal Payment Service
Use PayPal Web Service to learn different concepts like Authentication using OAuth 2.0, passing of access tokens to different requests, and executing GET, COMPLEX POST requests
Use OAuth 1.0 authentication with Twitter to create Tweets, read tweets using Rest-Assured
Authenticating into applications which implement Form Authentication using Spring Security
Authenticating into applications that implement Form Authentication using Spring Security & CSRF token implementation.
Sending Soap Requests using Rest-Assured
Sending requests via Proxy Server
Parsing HTML Data using JSOUP Library
Using JSONAssert Library to assert on complete JSON responses
Learn to use setup & configure Allure Reports
Provide beautiful DisplayNames, Descriptions, link information in your reports
Add detailed test step information & attachment information in the reports
FRAMEWORK DEVELOPMENT WITH JAVA, JUNIT, ALLURE REPORTS
Continuous Integration(CI) with Git, Github & Jenkins
At the end of this course, you will feel at "Rest" and will be "Assured" to take up API Testing, API Automation and successfully execute it in your organization!