Skip to content

Example UI Test using Selenium Webdriver & Python Unittest

Notifications You must be signed in to change notification settings

xbns/python-ui-tests

Repository files navigation

What this project is for?

This project is a selenium python UI testing project. The script therein does the following:

  1. Navigates to this site https://www.ultimateqa.com/filling-out-forms
  2. Fills in the first form.
  3. Clicks the submit buttom
  4. Checks for the successful message

Steps

  1. Clone the repository
$ git clone https://github.com/jaymutuku/python-ui-tests
$ cd python-ui-tests/

Create and Activate a Virtual Environment

$ pip3 install virtualenv
$ virtualenv -p python3 venv 
$ source venv/bin/activate

Incase you get an error in the second step above: command 'virtualenv' not found ... Then

$ sudo apt install virtualenv

Install the required packages

$ pip install selenium

You don't need to install the unittest library is a built-in library.

Save the dependencies to requirements.txt

$ pip freeze > requirements.txt

Running a single test case

   $ python -m unittest testcases.test_ui.verifyMessageTest

Running all tests

   $ python -m unittest discover

Expected Output

.
----------------------------------------------------------------------
Ran 1 test in 11.108s

OK

About

Example UI Test using Selenium Webdriver & Python Unittest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages