Skip to content

zerodayz/express

Repository files navigation

EXP Framework for Selenium

Table of contents

Introduction

This is a framework for Selenium tests written in Python. It is based on Selenium and pytest.

Prepare the environment

chmod +x express-install && ./express-install

You should see:

...
Done!

Please restart your shell or run:
    source <YOUR_HOME>/<SHELL_RC_FILE>

To get familiar with express execute:
    express-run -h

Combination with Selenium IDE

Export the Python pytest from Selenium IDE and copy inside test folder.

cp exported/test_login.py express/test/

Run the tests

Syntax

express-run -n|--number <tests_in_parallel> --headless --browser <browser1> --browser <browser2> <test_file.py>

Examples

  1. If you are not in a rush, you can run the tests sequentially on a single browser.
express-run --browser chrome test/test_example.py
  1. If you want to run the tests in parallel on a single browser, you can use the -n option.
express-run -n 2 --browser chrome test/test_example.py
  1. If you want to run the tests in parallel on multiple browsers, you can use the --browser option multiple times.
express-run -n 2 --browser chrome --browser firefox test/test_example.py
  1. If you want to run the tests in parallel on multiple browsers in headless mode, you can use the --headless option.
express-run -n 2 --browser chrome --browser firefox --headless test/test_example.py

Parallelism

For example if I execute test/test_login.py with 2 browsers and two accounts.

express-run --headless --browser chrome --browser firefox test/test_dropdown.py

It will factually run 2 tests per browser, so 4 tests in total.

The time is 17.01s for these 4 tests.

Now if instead I use -n 4 to run 4 tests in parallel.

express-run --headless -n 4 --browser chrome --browser firefox test/test_login.py

The time is 8.42s for the same 4 tests.

It is good improvement if you have too many tests to run.

Collaborate

Compatibility with Formy

This is covering what tests are available and compatible with https://formy-project.herokuapp.com/.

  • Autocomplete
  • Buttons
  • Checkbox
  • Datepicker
  • Drag and Drop
  • Dropdown
  • Enabled and Disabled elements
  • File Upload
  • Key and Mouse press
  • Modal
  • Page Scroll
  • Radio Button
  • Switch Window
  • Complete Web Form

Documentation

Please see the documentation.

Contact us

About

EXP Framework for Selenium

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages