/Selenium-Demo

Solutions to Web Automation Challenges using Selenium in Python

Primary LanguagePython

Selenium Demo Exercise Solutions

Python Symbol Selenium Symbol

Automation Image

Solutions of the automation exercises available at Easy Selenium Demo

Level

Solutions

Basic Basic Challenges Solutions
Intermediate Intermediate Challenges Solutions
Advanced Advanced Challenges Solutions

Installation and Usage

  1. Clone this GitHub repository

    git clone https://github.com/josewebdev2000/Selenium-Demo.git
  2. (Optional) Create a Python virtual environment for the solutions

    python3 -m venv <your_venv_name>
  3. Install the required dependencies from the (requirements.txt) file

    pip3 -r install requirements.txt
  4. Go to the directory of interest

    cd <directory_of_interest>

    Example:

    cd basic
  5. Provide required environment variables

    There are two environment variables that are required to run any automation script found in this project

    DRIVER_PATH

    This is the path to the folder that contains the web browser driver. Since this project uses Firefox. Then, supply the path to your geckodriver

    Linux Command
    export DRIVER_PATH=<path_to_folder_of_your_geckodriver>
    Windows Command
    set DRIVER_PATH=<path_to_folder_of_your_geckodriver>
    BIN_PATH

    This is the path to the executable binary of the web browser. Since this project uses Firefox. Then, supply the path to your firefox executable file.

    Linux Command
    export BIN_PATH=<path_to_your_firefox_binary>
    Windows Command
    set BIN_PATH=<path_to_your_firefox_binary>
    Note

    If your operating system is Ubuntu the following values have been provided to you by default

    DRIVER_PATH=/usr/local/bin
    BIN_PATH=/usr/bin/firefox

    As a result, as long as the path to the folder to your geckodriver is /usr/local/bin you WON'T need to set up the DRIVER_PATH environment variable.

    Likewise, as long as the path to your firefox binary is /usr/bin/firefox you WON'T need to set up the BIN_PATH environment variable.

  6. Run the challenge solution of interest

    python <solution_of_interest_file_name>.py

    Example:

    python simple_form_solution.py