Page Objects for Python
Project description
Page Objects are a testing pattern for websites. Page Objects model a page on your site and provide accessors and methods for interacting with this page, both to reduce boilerplate and provide a single place for element locators.
This project is an implementation of this pattern for Python using Selenium webdriver.
[](https://travis-ci.org/eeaston/page-objects)
Documentation
Quick Example
>>> from page_objects import PageObject, page_element >>> from selenium import webdriver >>> >>> class LoginPage(PageObject): username = page_element(id_='username') password = page_element(name='password') login = page_element(css='input[type="submit"]')>>> driver = webdriver.PhantomJS() >>> driver.get("http://example.com") >>> page = LoginPage(driver) >>> page.username = 'secret' >>> page.password = 'squirrel' >>> assert page.username.text == 'secret' >>> page.login.click()
Installation
$ pip install page_objects
Project History
This was originally part of the pkglib project at http://github.com/ahlmss/pkglib, it has been forked to retain history.
Release History
1.0.0 (2014-09-29)
Initial export from http://github.com/ahlmss/pkglib
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file page-objects-1.0.0.tar.gz.
File metadata
- Download URL: page-objects-1.0.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5af01e1f6d87dd82ca460f96f29413bccad515a0866c53320b1de2e063e993bc
|
|
| MD5 |
f24ddf62e0ee38429782874cfd00c539
|
|
| BLAKE2b-256 |
9f0bcf51c04a88f1d882cac203ef1bbb3e368567e83e408b86987db8d33795e1
|
File details
Details for the file page_objects-1.0.0-py2-none-any.whl.
File metadata
- Download URL: page_objects-1.0.0-py2-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87e72ef0bc76a974c39e3c84277e42d5d8c8ac3c69afe4547924692e72618484
|
|
| MD5 |
e8b6c5e94160c549ccf4443fbe25a206
|
|
| BLAKE2b-256 |
c0de905db83321b68e0206057728059c4684bbe5ba64a22beb6ce013a20ad45d
|