Skip to content
raddhakrishnan edited this page May 7, 2018 · 16 revisions

The setup for our open-sourced Python test automation framework is fairly simple. Don't get fooled by the length of this section. We have documented the setup instructions in detail so even beginners can get started.

The setup has four parts:

  1. Prerequisites
  2. Setup for GUI/Selenium automation
  3. Setup for Mobile/Appium automation
  4. Setup for API automation

1. Prerequisites

a) Install Python 2.x

b) Add Python 2.x to your PATH environment variable

c) If you do not have it already, get pip (NOTE: Most recent Python distributions come with pip)

d) pip install -r requirements.txt to install dependencies

If you ran into some problems on step (d), please report them as an issue or email Arun([email protected]).

2. Setup for GUI/Selenium automation

a) Get setup with your browser driver. If you don't know how to, please try:

For Chrome

For Firefox

#Note: Check Firefox version & Selenium version compatibility before downloading geckodriver.

If your setup goes well, you should be to run a simple test with this command:

  1. Chrome: pytest -k example_form -B Chrome

  2. Firefox: pytest -k example_form -B Firefox

Optional steps for integrating with third-party tools:

3. Setup for Mobile/Appium automation

a) Download and Install appium desktop app

b) Download and Install Android Studio and create an emulator

c) Install Java JDK

d) Install the appium Python client library pip install Appium-Python-Client

If your setup goes well, you should be to run a simple mobile test with this command after starting the Appium and Android emulator: pytest -k mobile_bitcoin_price -H $Emulator_OS_Version -I $Emulator_Name

Optional steps for more details on setting up appium and running tests on Android or iOS refer to below links:

4. Setup for API automation

a. Get Cars API code from repo https://github.com/qxf2/cars-api using command "git clone https://github.com/qxf2/cars-api.git"

b. Install Flask using command "pip install flask"

c. Run cars-app server using command "python cars-api/cars_app.py"

d. Run test_api_example now using command "pytest -k api -s"

Optional steps for more details on setting up API and running tests refer to below link:

Clone this wiki locally