Getting Started¶
Requirements¶
Python >= 3.6
Setup¶
Specifying the automation library¶
Using a stere.ini file, the automation library used can be specified. This determines which library specific Fields are loaded.
While only Splinter and Appium have custom Fields to take advantage of their specific capabilities, any automation library that implements an API similar to Selenium should be possible to connect to Stere.
splinter is used by default, and appium is supported. Any other value will be accepted, which will result in no specific Fields being loaded.
[stere]
library = appium
Stere.browser¶
Stere requires a browser (aka driver) to work with. This can be any class that ultimately drives automation. Pages, Fields, and Areas inherit their functionality from this object.
Here’s an example with Splinter:
from stere import Stere
from splinter import Browser
Stere.browser = Browser()
As long as the base Stere object has the browser set, the browser’s functionality is passed down to everything else.
Stere.base_url¶
Optionally, an attribute called base_url can be provided a string that will be used as the base for all urls returned by Page.page_url
from stere import Stere
from splinter import Browser
Stere.browser = Browser()
Stere.base_url = 'http://foobar.com/'
class MyPage(Page):
def __init__(self):
self.url_suffix = 'mysuffix'
>>> MyPage().page_url == 'http://foobar.com/mysuffix'