Skip to content

The Page Object Pattern in Selenium is a design pattern used to create an abstraction of web pages, allowing for easier interaction and maintenance in tests. It involves creating a separate class for each page, with methods for elements and actions on those pages. This makes tests more readable and maintainable.

adamTarasiewicz/python-selenium

Repository files navigation

Welcome to my first test project with implemented Page Object Model.

Python | Selenium | Page Object

In theory, by applying this design pattern we can gain:

  • Reduction of duplicate code
  • Easier use of the same code in multiple tests
  • Increased test readability
  • Easier code maintenance

In BasePage you can find all basic operations done on a website. It inherits it's methods for all other Page classes.

To run this program:

  1. Run pytest Tests/test_RegistrationPage.py for account creation on a seleniumdemo.com website. Created account is valid for 24 hours. By that time it's deleted.
  2. Run pytest Tests/test_LoginPage.py for login test

Thanks for checking it out!

About

The Page Object Pattern in Selenium is a design pattern used to create an abstraction of web pages, allowing for easier interaction and maintenance in tests. It involves creating a separate class for each page, with methods for elements and actions on those pages. This makes tests more readable and maintainable.

Topics

Resources

Stars

Watchers

Forks

Languages