Skip to content

A demo project that automates web browser using Selenium and Gauge in Python.

Notifications You must be signed in to change notification settings

osandadeshan/gauge-python-selenium-demo

Repository files navigation

Gauge Python Selenium Example Project

This project serves as an example for writing Automation using Gauge.

This project uses:

  • Selenium
  • Snap CI has been setup to run the Gauge Specs from this project.

Concepts Covered


Pre Requisites

  • Python 3

  • Install Gauge

    On Windows

    1. Install Chocolatey by executing the following command.
      @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

    2. Install Gauge by executing the following command.
      choco install gauge

    On MacOS

    1. Update Homebrew.
      brew update

    2. Install Gauge using Homebrew.
      brew install gauge

    On Linux

    1. First, add Gauge’s GPG key with this command.
      sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-keys 023EDB0B

    2. Then add Gauge to the repository list using this command.
      echo deb https://dl.bintray.com/gauge/gauge-deb nightly main | sudo tee -a /etc/apt/sources.list

    3. Finally, install Gauge using these commands.
      sudo apt-get update
      sudo apt-get install gauge

  • Open Command Prompt and execute following commands.
    [pip / pip3] install getgauge
    gauge install python
    gauge install html-report
    gauge install json-report
    gauge install xml-report
    gauge install spectacle
    gauge install flash

  • You can check the installation using the following command.
    gauge -v

    If the installation is success, it will output like this:

   Gauge version: <version number>
   Plugins
   -------
   flash (<version number>)
   html-report (<version number>)
   python (<version number>)
   json-report (<version number>)
   spectacle (<version number>)
   xml-report (<version number>)

Executing specs

Set up

This project requires pip to install dependencies. To install dependencies run:

pip install -r requirements.txt

Run the following command to install chromedriver, if it fails then download it from here and add it to the PATH variable.

[pip / pip3] install chromedriver_installer

All specs

gauge run specs

This will also compile all the supporting code implementations.

About

A demo project that automates web browser using Selenium and Gauge in Python.

Resources

Stars

Watchers

Forks