Selene - Concise API for Selenium in Python

https://travis-ci.org/yashaka/selene.svg?branch=master https://codecov.io/gh/yashaka/selene/branch/master/graph/badge.svg https://badges.gitter.im/gitterHQ/gitter.svg

(Selenide port in Python)

Main features:

  • Concise API for Selenium
  • jQuery-style selectors
  • Ajax support
  • PageObjects support
  • Automatic driver management

Selene was inspired by Selenide from Java world.

Tests with Selene can be built either in a simple straightforward “selenide’ style or with PageObjects composed from Widgets i.e. reusable element components.

Installation

latest release version

$ pip install selene

latest development version

$ git clone https://github.com/yashaka/selene.git
$ python setup.py install

latest published pre-release version

$ pip install selene --pre

Quick Start

Basic Usage: 4 pillars of Selene

All Selene API consists just from 4 pillars:

  1. Browser Actions (including finding elements)
  2. Custom Selectors
  3. Assertion Conditions
  4. Custom Configuration

And one more not mandatory bonus:

  1. concise jquery-style shortcuts for finding elements

All pillars are reflected in corresponding selene python modules and their methods.

from selene.api import *

browser.open_url('https://todomvc4tasj.herokuapp.com')
s("#new-todo").should(be.blank)
s("#new-todo").set_value(1).press_enter()
ss("#todo-list>li").should(have.exact_texts("1"))

Further Documentation Guides