
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Install python on Windows via Python.org, choose the appropriate release, run the Windows installer, add Python to path, and verify the version in command prompt.
Learn to design a modular, data-driven test framework with pytest in Python for rest api testing. See how simple syntax, fixtures, and ci integration streamline test development and reporting.
Learn how to write a pytest test from scratch, name test files and functions correctly, and run arithmetic tests in Python using clear conventions and verbose output.
Discover how pytest discovers tests by default test naming conventions and how to run them from the command line across directories, files, and individual functions.
Discover how __init__.py turns folders into Python packages for pytest test discovery across subdirectories, even with identical module names.
Explore pytest command line options, including -V verbose, -K and -M selectors, --collect-only, -x exit, --maxfail, -s for print output, and junitxml reporting for Jenkins.
Learn to use pytest parameterization to perform data-driven testing with multiple username and password combinations, using pytest.mark.parametrize to run a single test across a list of values.
Explore essential Python file operations for your test framework, including open and file modes (r, w, a), and reading methods (read, readline, readlines) with safe closing.
Discover how JSON serves as a lightweight, language-independent data interchange format for client-server communication. Understand JSON objects, key-value pairs, types, serialization, and using Python's JSON module with API responses.
Learn to serialize Python dictionaries into JSON strings using the json.dumps method, and print formatted output to debug API responses and understand JSON structures.
Explore json operations in Python, converting json strings to data with loads and reading json files with load, then traverse dictionaries to access keys and values for api testing.
Validate json strings by using json loads and json load to parse from strings or files, handle value errors, and perform preliminary validation for API tests.
Explore free API URLs like httpbin.org and Swagger Pet Store to practice API testing with curl, covering GET, POST, PUT, DELETE, and JSON responses in Python pytest.
Explore the Python requests library to send HTTP requests and obtain a response object with data, status, headers, and encoding. Learn to use get and post methods, URL, and optional args like params and timeout, and inspect r.text, r.headers, r.status_code, and r.json for API testing.
Learn how to use Python's requests module to build API tests by passing URL query strings with key-value parameters using the params option, and parse the JSON response.
Learn to set custom headers in Python requests for API testing, including content-type, accept headers, and JSON payloads with json.dumps.
Explore using Python's csv module to drive data-driven tests, reading CSV data with reader and DictReader and handling headers and rows.
Explore rest APIs and http fundamentals, defining terms like url endpoints and status codes, and verbs such as get, post, put, and delete for API testing within a test framework.
What is API and WebServices
Explore rest apis as a lightweight, stateless web architecture that uses http methods to manipulate resources identified by urls, returns json representations, and enables interoperable, scalable api design.
Explore rest api request and response compositions, including endpoints, urls, http methods, headers, body, and parameters, and learn how to test these with a pet store example.
What should be our API Test strategy
A test framework is a set of tools and components that help you to write, execute, and manage tests.
Learn the necessary modules in a test framework.
Start design the test framework
How API test is done, using rudimentary approach.
Use GET method request
How API test is done, using rudimentary approach.
Use POST method request
Start building framework by adding utilities functions
Create a reusable utils module for get API calls with headers, return data, status, and time taken. Then implement a pets API test validating the response ID.
Start building framework, by using configuration files
Start building framework, by using configuration files, and configparser functions
Update a pet on the server with a put request, implement a put data utility, build tests with a payload, and validate id, name, and status.
Understand why we need logging and its benefits
Demo on using Python & Pytest Logging in Test Framework.
About API server, running in local system. Useful for API testing and learning.
Download and use API server from GitHub
Learn how to use curl, a cross-platform command line tool for testing REST APIs, performing get and delete requests, with options like -X and -H before automated Python pytest tests.
Master curl basics by sending headers with -H, timing out with -M, saving output with -O, and using -V for verbose testing of the get all user count endpoint.
Design and implement api tests with pytest by building api utils, configuring a local server, and validating payloads, headers, and basic performance. Organize test files and naming for clarity.
Learn to add pytest tests for the all user count API, organize into modules, and validate status codes, headers, and payloads with a mix of API-name and test-type approaches.
Learn to write api tests with pytest, including adding a get all user count test, validating response data and status, and measuring response time with fixtures.
Explore scenario parameterization in pytest to feed multiple inputs into the same test, enabling data-driven API tests, varied headers and status checks with a single test function.
Learn to post to the register API by reading the request body from a JSON file, update API utils, and test with valid.json in the test data folder, expecting 201.
Test API's which need Tokens. In first part we'll see how it is done in a rudimentary approach.
Test API's which need Tokens. How we can handle fetching tokens from Pytest Fixtures and using in all our test modules. Also learn about sharing fixtures.
explore data driven testing by reading csv data files to test multiple login credentials, and build a csv reader that returns dicts for easy json payloads.
Learn how to implement a data driven test for a register API using a CSV data file, building payloads, posting to the API, and asserting created IDs.
Apply pytest parameterization to run multiple API data sets as separate tests, covering empty, valid, invalid, and boundary cases with data files and a utils function for reading data.
Create a data file for api tests and implement a utils function to read csv data as a list, then transform to tuples for parameterized pytest tests validating status codes.
Use data driven testing with parameterized pytest to generate separate tests from a csv data file for api registration, building a request dict via zip, and asserting status codes.
Welcome!
Test frameworks are tools that software developers and quality assurance professionals use to automate the process of testing software applications. These frameworks provide a set of predefined rules, guidelines, and features that help in organizing, executing, and reporting the results of the tests.
Some of the key features of test frameworks include the ability to define test cases, assertions, and fixtures, which are reusable components that simplify the process of testing. They also often provide integration with other tools, such as continuous integration and deployment (CI/CD) pipelines, to automate the testing process and improve the efficiency of the development process.
Test frameworks are typically designed to support different types of testing, including unit, functional, API, Usability, Integration and performance testing. They can also support different programming languages and platforms, allowing developers to choose the one that best suits their needs.
Examples of popular test frameworks include JUnit for Java applications, NUnit for .NET applications, and Pytest for Python applications. There are also specialized test frameworks available for specific types of testing, such as Selenium for web application testing and Appium for mobile application testing.
In this course we are going to learn how to Design and Build a Test Automation Framework. The underlying framework will be PYTEST and we will build a Hybrid kind of framework which will be:
Modular-Based,
Data-driven, & also
Library/Utils Driven Architecture.
This framework will be extensible and scalable where in you extend to any types of tests like e.g. DB testing, UI testing and others. We will structure our test project framework to be able to handle complex scenarios also.
Some of the modules or components we will have in our Hybrid Test Framework are as:
- Test Runner: This is the module responsible for executing tests and reporting the results. Pytest is what we will be using here, to take the benefits of Python.
- Utils/Library module: Will contain all reusable functions such as databases, generic functions, application functions etc.
- Config Management module: Separate config files and config manager to enable different config files.
- Data Management module: Should support Data Driven capability. Handle Scripts and Data separately.
- Logging & Reporting: Separate the logging code from the main code, making it easier to maintain and update the test code base.
These are some of the modules found in test frameworks we will talk about in this course. And also how to incorporate them in our framework and build a structured automation framework that will be easy to maintain and flexible enough to add new test scenarios or new functions.
Of-course the specific modules you need in your test framework will depend on the needs of your testing process, such as the types of tests you need to run, the technologies you're using, and the size and complexity of your testing infrastructure. But this course will give you a really good start towards your automation journey, and also make it easier for you to design a test automation framework.
After taking this course you will:
Have the skills and knowledge needed to build and implement a successful test framework that can improve the quality and reliability of software applications.
Be able to easily start adding test scripts functions and modules in a test framework.
Be able to design and build your own test framework from scratch.
Understand the components in any testing framework.
Be able to suggest changes to existing frameworks your team might be using.
Design organize your tests properly in any test automation project.
Learn API testing automation as well.
Be able to take test automation interviews easily.
And, Improve your career prospects
Finally, take another big step towards Test Architect.
Overall, taking the course on "Building a Test Framework" can be a great investment in your professional development and can help you build the skills and knowledge needed to succeed in the software industry.
Sign in and lets learn to build test automation frameworks and write tests in a structured way.
Thank you and see you in the course!
Tags: Python Test Framework, Pytest Framework Automation, API Test Framework, API Automation, Integration Testing, Software Testing