Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cle-b/niobium
Niobium extends the Python Selenium client with nice features.
https://github.com/cle-b/niobium
Last synced: 13 days ago
JSON representation
Niobium extends the Python Selenium client with nice features.
- Host: GitHub
- URL: https://github.com/cle-b/niobium
- Owner: cle-b
- License: apache-2.0
- Created: 2019-07-22T19:43:39.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-06T09:09:32.000Z (about 2 years ago)
- Last Synced: 2024-04-29T23:00:03.752Z (7 months ago)
- Language: Python
- Homepage:
- Size: 325 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black) [![Build Status](https://travis-ci.org/cle-b/niobium.svg?branch=master)](https://travis-ci.org/cle-b/niobium) [![Documentation Status](https://readthedocs.org/projects/niobium/badge/?version=latest)](https://niobium.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/niobium.svg)](https://badge.fury.io/py/niobium)
# Niobium
Niobium extends the Python Selenium client with nice features.
## Why Niobium
Selenium is probably the better tool for web automation. But sometimes it's hard to write a clean automation script.
With Niobium you can keep using Selenium and simplify your scripts. For example, Niobium adds a new element locator, find_element_by_image, which adds image recognition capacity in order to find an element in the webpage.
The goal of Niobium is not to replace Selenium. We only want to add to Selenium the functions we will love to see in Selenium natively.
Niobium philosophy is to keep as simple as possible.
## Installation
Niobium is available on Pypi, so simply use pip.
pip install niobium
## Getting Started
In order to use Niobium, you just need to import it in your script. Selenium will be automatically extended.
# -*- coding: utf-8 -*-
from selenium import webdriver
import niobiumdriver = webdriver.Firefox()
driver.implicitly_wait(10)
driver.get("https://www.python.org/")
driver.find_element_by_image("logo_python.png")driver.quit()
In order to avoid warning with your linter, you can import selenium from niobium.
# -*- coding: utf-8 -*-
from niobium import seleniumdriver = selenium.webdriver.Firefox()
...or simply disable the warning, like in this example for flake8
# -*- coding: utf-8 -*-
from selenium import webdriver
import niobium # noqa: F401driver = webdriver.Firefox()
...If you use pytest and especially pytest-selenium, just import niobium in your conftest.py.
## Documentation
[https://niobium.readthedocs.io/](https://niobium.readthedocs.io/)
## Warnings
Some features implemented in Niobium are here only to help you when there is no other easy solution. If you do a bad usage of Niobium features, it can result to a bad performance in your script, or it will be difficult to maintain it. Please read the documentation in order to know the special warnings for the use of these features.
Niobium do not modify the Selenium library package. The patches are only applied at runtime.