Skip to main content
All CollectionsTesting Types and ApproachesAutomated TestingFramework Setup
Selenium Python Hybrid Framework Installation Guide
Selenium Python Hybrid Framework Installation Guide

Installation guide for Selenium Python Hybrid Framework

Doris Sooläte avatar
Written by Doris Sooläte
Updated over a year ago

Index

  1. Python

  2. PyCharm IDE

  3. UiAutomator2 Driver for Android

  4. Java 8

  5. Mac, Windows, or Linux OS with the ability to run the Android SDK

  6. Node.js

  7. NPM

  8. Android Studio

  9. Appium

For Windows

In Linux or MacOS, Python is installed by default. However, in Windows, we have to download Python from the link https://www.python.org/downloads/.

Click on Download Python <version> button. Once the download is completed, the Python executable file gets saved in our system. Click on this file, and the Python installation landing page gets opened. Then, click on Install Now.

Once the installation is completed, Python gets downloaded in the path −

C:\Users\<User>\AppData\Local\Programs\Python\Python<version>

We have to configure the path of the Python folder along with the Scripts folder (generated within the Python folder) in the Environment variables.

To verify, Python has been installed, run the command:

python --version.

To install the Selenium bindings in our system, run the command:

pip install selenium

As this is done, a folder called Selenium should get created within the Python folder.

To update the existing version of Selenium, run the command:

pip install –U selenium

We should have an editor to write the Selenium scripts in Python.

Here is a step by step process on how to download and install Pycharm IDE on Windows:

Step 1) To download PyCharm visit the website https://www.jetbrains.com/pycharm/download/ and Click the “DOWNLOAD” link under the Community Section.

Step 2) Once the download is complete, run the exe for install PyCharm. The setup wizard should have started. Click “Next”.

Step 3) On the next screen, Change the installation path if required. Click “Next”.

Step 4) On the next screen, you can create a desktop shortcut if you want and click on “Next”.

Step 5) Choose the start menu folder. Keep selected JetBrains and click on “Install”.

Step 6) Wait for the installation to finish.

Step 7) Once installation finished, you should receive a message screen that PyCharm is installed. If you want to go ahead and run it, click the “Run PyCharm Community Edition” box first and click “Finish”.

Step 8) After you click on “Finish,” the Following screen will appear.

For Windows

Follow below steps to complete your Java installation.

  • Go to the Java Downloads Page and click on the option for Java Platform (JDK).

  • In the next page, select the Accept License Agreement radio button, accept it and click the download link against your matching system configuration.

  • You can run the installer once the download is over and follow onscreen instructions.

    • Go to start and search for ‘System’

    • Click on ‘System’

    • Click on ‘Advanced system settings’

    • Click on ‘Environment Variables’ under ‘Advanced’ tab as shown below:

  • Next, under system variables choose new and enter the variable name as ‘JAVA_HOME’ and the full path to Java installation directory as per your system as shown below:

    • Below figure depicts the configuration of environment variable name and value.

    • Next thing that you have to do is to configure your environment variables. Let’s see how to do that. Here, you have to edit the path of the system variable as shown

  • Under ‘Variable value’, at the end of the line, enter the following path –%JAVA_HOME%bin;
    Now, you can click ‘OK’ and you are done.

  • Now to cross-check the installation, just run following command in cmd – java -version. It should display the installed version of Java in your system.

For MacOS

  1. To check the JAVA_HOME variable execute the following command in Terminal:

    echo $JAVA_HOME
  2. If the output is not empty, it means that JAVA_HOME is set. But you should make sure that it points to the JDK version 1.8. Compare it with the output from the execution following command in Terminal:

    /usr/libexec/java_home -v 1.8
  3. Otherwise, if the output is empty or it differs from the actual JDK path, you should add the following line to the ~/.bash_profile file:

    export JAVA_HOME=$(/usr/libexec/java_home)

For Linux

  1. To check the JAVA_HOME variable execute the following command in Terminal:

    echo $JAVA_HOME
  2. If the output is not empty, it means that JAVA_HOME is set. But make sure that it points to the JDK version 1.8.

  3. Otherwise, if the output is empty or it differs from the actual JDK path, you should add the following line to the ~/.bashrc file:

    export JAVA_HOME=<path to JDK 1.8>

For Windows

The first step in using Node.js is the installation of the Node.js libraries on the client system. Below are the steps to download and install Node.js in Windows:


Step 1) Download Node.js Installer for Windows

Go to the site https://nodejs.org/en/download/ and download the necessary binary files.

In our example, we are going to Download Node.js on Windows with the 32-bit setup files.

Step 2) Run the installation

Double click on the downloaded .msi file to start the installation.

Click the Run button on the first screen to begin the installation.

Step 3) Continue with the installation steps

In the next screen, click the “Next” button to continue with the installation

Step 4) Accept the terms and conditions

In the next screen, accept the license agreement and click on the Next button.

Step 5) Set up the path

In the next screen, choose the location where Node.js needs to be installed and then click on the Next button.

  • First, enter the file location for the installation of Node.js. This is where the files for Node.js will be stored after the installation.

  • Click on the Next button to proceed ahead with the installation.

Step 6) Select the default components to be installed. Accept the default components and click on the Next button.

Step 7) Start the installation

In the next screen, click the Install button to start installing Node.js on Windows.

Step 8) Complete the installation

Click the Finish button to complete the installation.

For MacOS

  1. Open Terminal.

  2. Use the following Homebrew command to install Node & NPM:

    brew install node
  3. Execute the following command to ensure that Node has been installed, it should print the installed Node version:

    node -v
  4. Execute the following command to ensure that Node has been installed, it should print the installed NPM version:

    npm -v

For Linux

  1. Open Terminal.

  2. Use the following command to install Node & NPM:

    sudo apt-get install node
  3. Execute the following command to ensure that Node has been installed, it should print the installed Node version:

    node -v
  4. Execute the following command to ensure that Node has been installed, it should print the installed NPM version:

    npm -v

Let’s go to Android Studio Download and install Android Studio. After that, apply the following steps. Click the “Next” icons and finally click the “Finish“.

Click to download Android Studio based on your operating system Windows, macOS, Chrome OS, or Linux. We are going on with Windows.

After download the Android Studio, installation is straightforward. Click the next button.

Select all options and click the next button.

Select your directory or keep the default and click next. I kept it as default. ;)

And click the install button to start the installation process.

If it is your first time installing Android Studio then just select the “Do not import settings” option and click the OK button. If you are updating it, you can import your previous settings.

Click the next button and continue.

I installed the Android Studio with standard settings and configurations as shown below screenshot.

Select your UI Theme.

Click the “Finish” button and install the required tools.

Then, just wait until all libraries to be downloaded and the installation to be finished.

After all these steps, click the finish button.

After clicking the “Finish” button. Go to “Configure” > “SDK Manager” to get SDK information. It is required for Android SDK path settings.

Select your device’s or emulator’s Android API level (Version). We will go with Android 11 API, please install that one.

When took the below screenshot the latest version was 9.0 but for this example, we will go with Android 11. I am not using windows anymore thus I could not update the screenshot but I wanted to mention it to guide you correctly.

And select the required tools as shown below and click “OK.

Click OK one more time, please.

Click the Finish button and continue.

After the installation of the required tools, go to the SDK Manager page and copy the SDK path as shown below. We will use it. ;)

Download RapidEE tool and install it and open it as administrator.

And then add ANDROID_HOME variable and its path should be Android SDK’s path. Also, check your JAVA_HOME variable. JAVA_HOME should equal to JAVA SDK’s path.

Then, you need to add required Android tools and JAVA JRE paths to your system path as shown below.

After that, check your settings and installations. Open a command prompt window and type “sdkmanager –list” command as shown below.

And type “uiautomatorviewer” to check uiautomatorviewer is working properly.

Then, create a sample project in Android Studio and then click the link as shown below to install missing libraries.

After installation, click the Finish button.

After installing missing libraries you will see the device and little and sweet android icon. :) When you click this icon, you will open the android virtual device manager.

Let’s create a virtual device. I will also explain how to do mobile automation with a real device too. Don’t worry. ;) Click to “+ Create a Virtual Device” button.

Then, select a virtual device in the device list.

To run ARM-based apk files on X86 platforms (windows or mac),
please refer to this article: https://www.swtestacademy.com/how-to-run-arm-apk-on-x86-systems/

After coming back to the above article and after installing your device, you will see the below result.

Until now, we installed JAVA and Android-related libraries and did their settings and configurations. Now, it is time to download Appium.

Go to http://appium.io/downloads.html and click the “Appium-Desktop for OSX, Windows, and Linux” link.

On the below page, click “appium-desktop-Setup-1.20.2.exe” file. (I am writing this article the latest release is 1.20.2, you can install the latest version when you are installing appium.)

When the installation file downloaded, click run and start to install appium desktop.

When installation finished, double-click the appium icon and open the appium server as shown below.

Let’s click the “Advanced” tab and change the Server Address to “127.0.0.1” and click Allow Session Override for override session when there will be problems and click “Start Server”. If you will use a real device and then use “0.0.0.0” for “Server Adress”.

Set Android and JAVA home in Appium Desktop.

Give the required permission to Appium Server.

You will see the server up and running.

Did this answer your question?