
Explore the fundamentals of rest api and services, test data with a rest client library, and learn asynchronous, synchronous, and parallel testing with an open source framework and GitHub code.
Ensure you have a basic understanding of C# language, familiarity with Visual Studio Community Edition, and a Windows operating system before starting this course.
Identify and set up the required tools — Java Development Kit, Tomcat, Postman, and Visual Studio Community Edition — for rest api automation with RestSharp and Http Client.
Install jdk 1.8 on a 64-bit system, accept default settings, and verify with the command prompt. Set java_home and update path, using the program files shorthand to handle spaces.
Install Tomcat 9 on your local system using the official 64-bit executable, configure default settings and admin credentials, start the server, and access the management UI at localhost:8080.
Set up Visual Studio 2019 Community Edition by downloading the free edition, running the executable, and following prompts for installation and restart.
Set up Visual Studio community edition by using the installer to add tools and features, select .NET, modify the installation, and restart the system to finalize rest api automation readiness.
Download the official Postman executable for your operating system, run the installer by double-clicking, and launch Postman to send requests and receive responses.
Deploy a jersey framework application as a war on Tomcat, configure the management console, access endpoints for laptop details such as name, brand, features, and id, and test with Postman.
Understand what a web service is: a function or container that serves requests from a client over the internet, enabling resource access in a client-server architecture.
Describe how a client requests resources from a server, how the server processes the request, and returns a response, and compare soap and rest web services.
Describe rest as representational state transfer, a lightweight architecture for communication where resources can appear in different representations such as text, json, or xml.
Learn rest api automation with restsharp and http client by implementing create, read, update, and delete using post, get, put, and delete methods; includes a postman get request to google.com.
Understand how to format http requests with method, headers, and optional body, and how responses deliver headers, body, and status codes like 200 ok, including authentication considerations.
Learn how to create and configure a test project in Visual Studio, navigate the solution and test explorers, build and rebuild the solution, and apply settings across all projects.
Explore MSTest framework for .NET unit testing, learn core attributes such as TestClass, TestMethod, TestInitialize, TestCleanup, ClassInitialize, ClassCleanup, AssemblyInitialize, AssemblyCleanup, TestCategory, and Ignore.
Set up the M.S. test framework in your Visual Studio project by installing the M.S. test NuGet package and the test adapter, then clean and rebuild the solution.
Explain MSTest lifecycles with class and assembly initialize and cleanup, plus test initialize, test method, and test cleanup sequences, static signatures with test context, and ignore and category attributes.
Learn to set up the http client by installing the rest framework via a NuGet package, explore the package documentation, and use its classes to interact with a REST endpoint.
Interact with a rest api by creating the strategic land instance, building header and body payload, executing the request with the http client, and extracting content and status code.
Create an http client in .NET using RestSharp and HttpClient, send requests, view responses, and dispose of the client to close connections and free resources.
Capture the response from a request by using Task<T> with a response message type, a generic class, and its property to extract the content of the response.
Explore how to parse an API response by inspecting headers, status code, and content using postman, and understand common HTTP status codes like 200 and 202 in REST API automation.
Learn to capture the HTTP status code from responses using RestSharp and HTTP client, printing both the status description and its numeric value for standard codes.
Capture the response content by using the read as string method of the response content, which returns a task<string>, then print the data.
Explore how the api returns data in json and xml, showing json objects with nested data and xml root and child tags, with format specified in the request.
Set the accept header to request json or xml from an http client. Use default request headers to attach these options and validate with test methods.
Learn to send a GET request using SendAsync by creating a request message, setting the endpoint and HTTP method, adding headers, and invoking SendAsync to receive a response.
Use the using statement to automatically dispose resources, define scope for clients and requests, and avoid explicit dispose calls while adhering to IDisposable rules.
Refactor the code by creating a custom response class that encapsulates status and data, with a constructor, private fields, getters, and a toString override for formatted output.
Learn serialization and deserialization of API responses, extract data from the response stream, and simplify validation using RestSharp and HTTP client.
Install the deserialization packages to enable JSON handling for API responses in your RestSharp and HttpClient project. Use the solution's manage NuGet packages to add the appropriate JSON libraries.
Create a model to represent API responses by generating classes from a JSON schema, then add the root and property classes to the project's model directory as a placeholder.
Deserializes a json response using json convert from a json library, handles a list versus a single object, and accesses brand name, laptop name, and features.
Create an xml serializer instance with the model type, read the response data with a text reader, and parse it using the details method to assemble data into the model.
Create a model for xml deserialization by generating classes from an example xml response, add them to the project, and resolve references to System.Xml.Serialization.
Demonstrates XML data deserialization by configuring a serializer with the model type, reading with a text reader, and accessing properties like laptop brand and features.
Explore assertion concepts in rest api testing by defining checkpoints that compare actual and expected outputs, and learn how to add assertion methods to tests.
Learn to add assertions in tests for REST API automation, using static assert methods to verify status codes, non-null data, and expected responses with RestSharp and HTTP client.
Explore conditional based assertion, which evaluates a condition and a message to determine pass or fail, using contains checks in a list and equality assertions on branding.
Demonstrates how to create a post request to add a new record in a container, attach the body, and set the content-type header, using Postman to verify a 200 response.
Demonstrates crafting and sending a post request with http client, using string content and media type, generating a random id, and validating the response and data via a get endpoint.
Validate the response after a post by fetching a specific record with a get request, deserializing the json object, and verifying headers for the expected format using RestSharp.
Learn to sign a POST request with XML data, set the content type, and verify results via a GET endpoint using RestSharp and the HTTP client.
Validate a post request with XML data, fetch the specific record using an ID via a get request, deserialize the response, and assert success in REST API automation.
learn to send a post request using the send async method by configuring an http request message with json data, utf encoding, and media type in a test method.
This lecture demonstrates optimizing api tests by extracting repetitive steps from test methods into a helper class, creating methods for adding headers, building requests, and sending them with validation.
develop and optimize rest api calls by implementing a send request workflow with parameter handling, try-catch error handling, and response processing, including a get request helper and header management.
Build a framework post method with a static helper that accepts url, content, and headers, builds string content with a media type, and returns the response.
Explore how to use the framework method in a test class to send post requests with RestSharp or HTTP client, including headers and content payload, and validate responses.
Create a generic helper to deserialize JSON and XML responses, using a serializer and text reader, with a type parameter constrained to class to adapt to laptop or laptop hybrid.
Use the framework method to disclose response data in the test class for get and post endpoints, converting responses to a list<object> and accessing items by index.
Use postman to perform a put request updating a record by id with body containing a new feature like 1 tb of ssd, returning 200 or 404 if not found.
Automate rest api workflows by creating a post request to add a record, then a put request with xml data to update it, and validate with a get request.
Put a json data update via a put request, set the json media type header, and verify the response includes the new entry such as 1 tb or ssd.
Create a static framework method to perform put requests, with parameters for request, content, media type, and headers, building the content and returning a response as with post and get.
Demonstrates using the framework method to send a put request in REST API tests, leveraging a helper class to reuse code, set headers and media type, and validate the response.
Perform a delete request in Postman to remove a specific record by ID, verify deletion with a get request, and observe a not found response after repeated attempts.
Automate a delete request by posting a new record, calling the delete endpoint for a 200 response, and validating a 404 after deletion.
Learn how basic authentication secures endpoints by requiring a username and password, with the client sending credentials and the server granting access to protected resources.
Learn to build a secure get request to a protected endpoint, add an authorization header with encoded username and password, and verify a 200 status in a test method.
Learn how to encode and decode basic authentication using base64 for the authorization header by combining a username and password, then converting to a base64 string with UTF-8 encoding.
Configure secure get and post endpoints, implement a test method for post, perform a get request, add authorization header, and verify and display data.
Create a secure put endpoint by configuring private security variables and implementing secure put and secure post requests, with a basic authorization header using base64.
Learn to implement a secure delete endpoint with a delete request, add an authorization header, and use a helper class with an overloaded method to pass the endpoint and header.
**The course has been updated with the latest version of the RestSharp framework**
Currently, the IT industry is moving towards Micro Service based architecture. And it is very important to understand what are RESTful API and Web services. This course is all about that.
The Course is divided into 3 sections
In the 1st section, I will have a detailed discussion about the RESTful API and Webservices
In the 2nd section, I will discuss the HTTP Client library and how to use them for testing RESTful API
In the 3rd section, I will discuss the RestSharp framework and how to use it for API testing
I will also discuss synchronous and asynchronous execution. And how to run the test in parallel
In this course, I will also discuss some real-time APIs of the application. Such a Drop Box and JIRA
While going through this course, I will also develop a framework for testing. The source code of the framework will be provided for download
Unit Testing Framework MSTest
MSTest Framework
HTTP Client for API Testing
GET Request
Assertion and Validation
POST Request
PUT Request
DELETE Request
Authentication
Synchronous and Asynchronous Execution
Synchronous and Asynchronous Execution - Introduction
Synchronous Execution's of Test
Asynchronous Execution of Test
Asynchronous Execution of Test - Failed Scenario
Redefining HelperClass with Async & Await Implementation
Asynchronous Execution with Task Factory
Fetch the returned value from asynchronous task
Parallel execution with RunSettings File
RestSharp Framework
GET Request
Framework Design & Implementation
POST Request
PUT Request
Delete Request
Authentication
Token Based Authentication - DropBox API
Session Based Authentication - JIRA API