Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Running SeleniumBase Scripts

To run tests, make sure you've already installed SeleniumBase using pip install seleniumbase OR pip install -r requirements.txt + python install from the top-level directory.

You can interchange pytest with nosetests, but using pytest is strongly recommended because developers stopped supporting nosetests. Chrome is the default browser if not specified.

During test failures, logs and screenshots from the most recent test run will get saved to the latest_logs/ folder. Those logs will get moved to archived_logs/ if you have ARCHIVE_EXISTING_LOGS set to True in

(NOTE: Many tests in this folder fail on purpose to demonstrate the built-in logging, screenshots, and reporting features.)

Here are some example run commands to help get you started:

Run the example test in Chrome:

pytest --browser=chrome

Run the example test in Firefox:

pytest --browser=firefox

Run the example test in Demo Mode (highlights page objects being acted on):

pytest --browser=chrome --demo_mode

Run the example test suite and generate an pytest report: (pytest-only)

pytest --html=report.html

Run the example test suite and generate a nosetest report: (nosetests-only)

nosetests --report --show_report

Run a test using a nosetest configuration file: (nosetests-only)

nosetests --config=example_config.cfg

Run a test demonstrating the use of SeleniumBase Python decorators available:


Run a failing test: (See the latest_logs/ folder afterwards for logs and screenshots)

pytest --browser=chrome

Run a failing test with Debugging-mode enabled: (If a test failure occurs, pdb activates)

pytest --browser=chrome --pdb -s

For more advanced run commands, such as using a proxy server, see ../help_docs/

To makes things easier, here's a simple GUI program that allows you to kick off a few example scripts by pressing a button:


(NOTE: If you see any *.pyc files appear as you run tests, that's perfectly normal. Compiled bytecode is a natural result of running Python code.)