Skip to content

jfdahl/SeleniumFramework

Repository files navigation

Selenium Framework

Purpose: To build a framework around the Selenium WebDriver to simplify the basic capabilities that are most frequently used (in my experience anyway).

Instructions

  • Install Python version 3
  • Install the selenium bindings for Python: pip install selenium
    • Note: If you wish to run the test_framework.py script, you also need to install pytest.
  • Install the selenium_framework.py file into a location searchable by Python
    • i.e. site-packages or the folder containing your project scripts

Sample:

import selenium_framework as sf

CONFIG = {
    'browser': 'Chrome',
    'headless': True,
    'browser_size': (800, 600),
    'browser_position': (0, 0),
    'test_page': f'https://duckduckgo.com/'
}

driver = sf.Driver()
driver.open(CONFIG)
driver.goto(CONFIG['test_page'])

element = driver.find('name=q') 
element.send_keys('SeleniumHQ')
element.submit()

assert driver.browser.title == 'SeleniumHQ at DuckDuckGo'
driver.close()

Links

Selenium Website
Selenium Repo

Python API Documentation

Browser Drivers

Firefox Gecko Driver Documentation
Firefox Gecko Driver repo

Google Chrome Driver

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published