Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.12 KB

File metadata and controls

38 lines (27 loc) · 1.12 KB

Selenium with Python

Basic Selenium framework with pytest and unittest to write automated tests for webpages easily and quickly.

Description

This is a basic framework with Selenium that could be used to write automated tests for webpages.
The framework provides a quite simple way of performing browser operations such as getting an element, clicking, setting input values and asserting if an element is enabled or not. Using the element names defined in the model classes, we can easily write the test codes.
The test cases are written using both pytest and unittest.

Packages:

  • utils : libraries implementing the base page model class and the browser
  • models : libraries implementing the page models
  • tests_pytest : tests using pytest
  • tests_unittest : tests using unittest

Executing the tests

From the project root:

pytest:
python3 -m pytest tests_pytest

unittest:
python3 -m unittest discover tests_unittest

Or you can run the tests in IDEs such as PyCharm.


Third-party libraries used:

  • selenium
  • pytest

Python version used for the development: Python 3.9.6