In this post, NGA will walk you through major Python frameworks that can be used for test automation and building robust test automation frameworks for your clients.
UI Automation Frameworks:
selenium webdriver - Browser automation tool.
robotframework-selenium2library - Web testing library for Robot Framework.
selene - Concise UI tests in Python + Ajax support + PageObjects + Widgets
seleniumbase - A simple Python framework for building test automation with Selenium WebDriver. It depends on pytest or noose modules to run. When used with noose a HTML report can be generated in the end of the test run.
Toolium - Toolium is a Python wrapper tool of Selenium and Appium libraries to test web and mobile applications in a single project. It provides a way of choosing and configuring the driver through a configuration file, implements a Page Object pattern and includes a simple visual testing solution.
webdriver_manager - The main idea is to simplify managemet of binary drivers for different browsers.
gauge - Gauge is a light weight cross-platform test automation tool. It provides the ability to author test cases in the business language, actually written in golang with python language driver.
Pylenium.io - Pylenium brings the best of Selenium, Cypress and Python into one package.
Playwright - Playwright is a Python library to automate Chromium, Firefox and WebKit browsers with a single API. Playwright delivers automation that is ever-green, capable, reliable and fast.
splinter - A tool for test web applications with a simple for find elements, form actions, and others browser actions.
testutils sst - A web test framework that uses Python to generate functional browser-based tests.
wtframework - Framework for configurable Web Tests in Python.
webium - A Page Object pattern implementation library for Python
elementium - jQuery-style syntactic sugar for highly reliable automated browser testing in Python
slickqa - The slick-webdriver-python project is a wrapper around the python webdriver client bindings.
hitch - A high level integration testing framework for service based applications.
Needle - Needle is a tool for testing visuals with Selenium and nose. It checks that CSS renders correctly by taking screenshots of portions of a website and comparing them against known good screenshots. It also provides tools for testing calculated CSS values and the position of HTML elements.
PyPOM - PyPOM is a Python Page Object Model library for Selenium and Splinter tests.
pypom_form - PyPOM based page object model for schema based forms.
POM - POM is Page-Object-Model microframework to develop web UI tests easy, quickly and with pleasure.
websmith - A Domain Specific Language (DSL) for Web Testing.
pages - lightweight page object and component Python library for UI tests.
Golem - Golem is a complete test automation tool and framework for end-to-end testing. It creates powerful, robust and maintainable test suites, it's easy to learn even without a lot of programming knowledge. It is based on Selenium Webdriver and it can be extended using Python
Pylenium.io - Pylenium brings the best of Selenium, Cypress and Python into one package.
Mailosaur - Python client for email testing/automation via Mailosaur.
Rest API Automation Frameworks:
Rester - Framework for testing (RESTful) HTTP APIs
pyresttest - A REST testing and API microbenchmarking tool
siesta - Python REST Client
play_requests - pytest-play plugin driving the famous python requests library for making HTTP calls using plain YAML files
gabbi - a tool for running HTTP tests where requests and responses are expressed as declarations in YAML files.
Schemathesis - Schemathesis is a tool for property-based testing of applications based on Open API & Swagger specs. It reads the application schema and generates test cases which will ensure that your application is compliant with its schema. Includes pytest & unittest integrations.
Mobile Automation Frameworks:
appium - An open source test automation framework for use with native, hybrid and mobile web apps. It drives iOS and Android apps using the WebDriver protocol.
Airtest - Airtest is a cross-platform automated testing framework focusing mainly on games, but can also be used for native apps.
robotframework-androidlibrary - A Robot Framework test library for all your Android automation needs.
robotframework-appiumlibrary - An appium testing library for RobotFramework.
robotframework-ioslibrary - A Robot Framework test library for all your iOS automation needs.
uiautomator - Python wrapper of Android uiautomator test tool, it works on Android 4.1+ simply with Android device attached via adb.
ATX - Smart phone automation tool. Support iOS, Android, WebApp and game.
allure pytest - Allure adapter for PyTest framework.
HTMLTestRunner - An extension to the Python standard library's unittest module. It generates easy to use HTML test reports.
unittest-xml-reporting - A unittest test runner that can save test results to XML files that can be consumed by a wide range of tools, such as build systems, IDEs and continuous integration servers.
Unit Testing Frameworks:
unittest - is a library to make unit testing distributed with python out of the box.
unittest2 - is a backport of the new features added to the unittest testing framework in Python 2.7 and onwards.
pytest - is a mature full-featured Python testing tool that helps you write better programs.
plugincompat - Test execution and compatibility checks for pytest plugins
test-junkie - Highly configurable modern testing framework.
nosetests - is a nicer testing for python.
slash - is a testing framework written in Python.
lemoncheesecake - is a Python framework intended to functional testing, it provides fixtures, matchers, test organization through test suites hierarchy and metadata (test/suite name, description, tags, properties, links), rich reporting features and various report formats (JSON, XML, HTML, Junit)
proboscis - is a Python test framework that extends Python’s built-in unittest module and Nose with features from TestNG.
grail - is a library which allows test script creation based on steps.
testify - unit test framework, provides Enhanced test fixture setup, Split test suites into buckets for easy parallelization, PEP8 naming conventions & Fancy color test runner with lots of logging / reporting option.
trial - Extension of unittest to support writing asynchronous unit tests using Deferreds and new result types ('skip' and 'todo'). Includes a command-line program that does test discovery and integrates with doctest and coverage.
subunit - Transparently adds support for running unittest test cases/suites in a separate process : prevents system wide changes by a test destabilising the test runner. It also allows reporting from tests in another process into the unittest framework, giving a single integrated test environment.
testresources - Provides a mechanism for managing 'resources' - expensive bits of infrastructure - that are needed by multiple tests. Resources are constructed and free on demand, but with an optional TestSuite?, the test run order is optimised to reduce the number of resource constructions and releases needed. Compatible with unittest.
testtools - Useful extensions to unittest derived from custom extensions by projects such as Twisted and Bazaar.
Sancho - Sancho 2.1 runs tests, and provides output for tests that fail; Sancho 2.1 does not count tests passed or failed; targets projects that do not maintain failing tests
zope.testing - Powerful test runner that includes support for post-mortem debugging of test failures. Also includes profiling and coverage reporting. This is a standalone package that has no dependencies on Zope and works just fine with projects that don't use Zope.
pythoscope - Tool that will automatically, or semi-automatically, generate unit tests for legacy systems written in Python.
testlib - Gives more power to standard unittest. More assert* methods; support for module level setup/teardown; skip test feature...
dutest - An object oriented interface to retrieve unittest test cases out of doctests. Hides initialization from doctests by allowing setUp and tearDown for each interactive example. Allows control over all the options provided by doctest. Specialized classes allow selective test discovery across a package hierarchy.
green - Green is a clean, colorful test runner for Python unit tests. Compare it to nose or trial.
ddt - Data-Driven tests with unittest
pytractor is an extension to the Selenium bindings for Python. Its goal is to make testing of angular.js applications easier with Python.
stestr - A parallel Python test runner built around subunit.
Editors, IDE, consoles:
pycharm - Smart code editor provides first-class support for Python
pydev - Full featured python ide based on eclipse
sublime - A sophisticated text editor for code, markup and prose.
ipython - A command shell for interactive computing in multiple programming languages, originally developed for the Python programming language
VSCode - Very Neat Editor for python with loads of plugins