Skip to content

jonathanAnguise/Projektron-POM-Selenium-Example

Repository files navigation

Projektron POM Selenium Example

This repository contains a fully functional example of using the Page Object Model (POM) design pattern with Selenium for automating tests on Projektron. The aim is to demonstrate how to structure and implement a robust test automation framework in Python.

Table of Contents

Introduction

The Page Object Model (POM) is a design pattern in Selenium that creates an object repository for web elements. It enhances test maintenance and reduces code duplication. This example illustrates how to set up and use POM in a Selenium project for Projektron.

Features

  • Demonstrates the Page Object Model design pattern.
  • Uses Selenium WebDriver for browser automation.
  • Includes sample test cases for Projektron.
  • Easy to extend and maintain.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • Python 3.6 or higher
  • pip (Python package installer)
  • A web browser (Chrome, Firefox, etc.)
  • ChromeDriver or GeckoDriver (for Firefox)

Installation

  1. Clone the repository:

    git clone https://github.com/jonathanAnguise/projektron-automator
    cd projektron-pom-selenium-example
    touch .env
    echo "PASSWORD=Your_password" >> .env
    echo "USERNAME=Your_username" >> .env
    echo "URL=www.example.com" >> .env
  2. Create and activate a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt

Usage

  1. Edit task_text_to_imput.txt
  2. Input a day (arguments are optional):
    python main.py hours=4 minutes=36 title=great_title reference=my_ref
    If you don't provide arguments, the following default values will be used:
    "hours": 9
    "minutes": 0
    "title": "TA"
    "reference": "TA"

Project Structure

projektron-pom-selenium-example
├── input.bat
├── task_text_to_imput.txt
├── main.py
├── pages
│   ├── base_page.py
│   ├── login_page.py
│   └── main_page.py
├── README.md
├── requirements.txt
├── test_secret_manager.py
├── test_time_parser.py
└── utils
    ├── locators.py
    ├── secret_manager.py
    └── time_parser.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published