Splinter: A Python Framework for Web Application Automation

Summary
Splinter is a robust Python test framework designed for automating web applications. It provides a simple and consistent API, making browser interactions faster and more reliable. This tool is ideal for developers looking to streamline their web testing workflows with ease and flexibility.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
Splinter is a powerful and intuitive Python test framework built for web application automation. It offers a simple and consistent API, allowing developers to automate browser interactions quickly and reliably without unnecessary complexity. Designed for real-world use cases, Splinter guards against common automation quirks and provides robust support for multiple automation drivers, including Selenium, Django, Flask, and ZopeTestBrowser.
Installation
Getting started with Splinter is straightforward. You can install it using pip:
pip install splinter
For more detailed installation instructions and to set up specific drivers, refer to the official documentation.
Examples
Splinter's API is designed to be easy to learn and use. Here's a quick example demonstrating how to open a browser, navigate to Google, perform a search, and check for text presence:
from splinter import Browser
browser = Browser('firefox')
browser.visit('http://google.com')
browser.find_by_name('q').fill('splinter - python acceptance testing for web applications')
browser.find_by_name('btnK').click()
if browser.is_text_present('splinter.readthedocs.io'):
print("Yes, the official website was found!")
else:
print("No, it wasn't found... We need to improve our SEO techniques")
browser.quit()
Why Use Splinter?
Splinter stands out due to several key features that make it an excellent choice for web automation:
- Easy to learn: The API is designed to be intuitive and quick to pick up, reducing the learning curve.
- Faster to code: Automate browser interactions quickly and reliably, allowing you to focus on testing rather than fighting the tool.
- Powerful: Built for real-world scenarios, it effectively handles common automation challenges.
- Flexible: It provides access to lower-level tools, allowing you to break out into raw Selenium at any time for advanced control.
- Robust: Offers broad support for various automation drivers, ensuring compatibility with different testing environments.
Links
- Documentation: https://splinter.readthedocs.io
- Changelog: https://splinter.readthedocs.io/en/latest/changelog.html
- Tutorial: https://splinter.readthedocs.io/en/latest/overview/tutorial.html
- pytest-splinter: http://pytest-splinter.readthedocs.io
- Stere (Page Objects): https://stere.readthedocs.io/