August 2018
Beginner
160 pages
4h 8m
English
Selenium is a framework targeted to automating browsers, to test web applications (https://www.seleniumhq.org/). It lets you do things such as opening a web page, clicking on a button, and then ensuring that a certain page loads, all programmatically. It supports all the major browsers out there and has a thriving community.
pytest-selenium provides you with a fixture that lets you write tests that do all of those things, taking care of setting up Selenium for you.
Here's a basic example of how to visit a page, click on a link, and check the title of the loaded page:
def test_visit_pytest(selenium): selenium.get("https://docs.pytest.org/en/latest/") assert "helps you write better programs" in selenium.title elem = selenium.find_element_by_link_text("Contents") ...Read now
Unlock full access