Selenium Framework Setup & Usage Guidelines

Required Software / Tools Specifications

  1. Java

  2. Selenium

  3. Eclipse

  4. Maven Configuration

  5. GIT 2.4.1

  6. Tortoise GIT

  7. Android Studio

  8. Appium

  9. Node Js

  10. Google Chrome

HOW TO INSTALL AND CONFIGURE

Install Java

WINDOWS

Follow the below steps to complete your Java installation.

Java SE Development Kit 11- Selenium Installation-Edureka
  • 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 the ‘Advanced’ tab as shown below:

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

java installation - Selenium Installation- Edureka
  • The below figure depicts the configuration of the environment variable name and value.

    New System Variable java installation - Selenium Installation - Edureka


  • The 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 below.

Environment Variable path java installation - Selenium Installation - Edureka
  • 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 the following command in the cmd – java -version. It should display the installed version of Java in your system.

MacOS

  • To check the JAVA_HOME variable execute the following command in Terminal:

echo $JAVA_HOME
  • 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
  • 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)

Linux

  • To check the JAVA_HOME variable execute the following command in Terminal:

echo $JAVA_HOME
  • 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.

  • 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>

Android Studio Installation

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“.

android-studio-download-page

Click to download Android Studio based on your operating system Windows, macOS, Chrome OS, or Linux. We are going on with Windows. After downloading the Android Studio, installation is straightforward. Click the next button.

appium download

Select all options and click the next button.

appium server

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

appium desktop

And click the install button to start the installation process.

appium

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.

appium interview questions

Click the next button and continue.

appium capabilities

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

appium api

Select your UI Theme. I prefer Darcula because it is better for the eyes but you can go with the white classical theme if you want.

appium tutorial ios

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

appium tutorial java

Then, just wait until all libraries are downloaded and the installation is finished.

appium tutorial android

After all these steps, click the finish button.

appium tutorial

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

<a href=https://604223-1956433-raikfcquaxqncofqfm.stackpathdns.com/wp-content/uploads/2019/03/img_5c867de24bf51-600x440.png"/>

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.

<a href=https://604223-1956433-raikfcquaxqncofqfm.stackpathdns.com/wp-content/uploads/2019/03/img_5c867eb0055d6-600x423.png"/>

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

appium inspector

Click OK one more time, please.

ios testing

Click the Finish button and continue.

ios automation

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. ;)

android automation

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

android testing

And then add the 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.

uiautomator

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

selendroid

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

mobile automation

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

mobile testing tools

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

what is appium

After installation, click the Finish button.

download appium

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

install appium

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.

apium

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.

<a href=https://604223-1956433-raikfcquaxqncofqfm.stackpathdns.com/wp-content/uploads/2019/10/Pasted-into-Appium-Tutorial-Step-by-Step-Appium-Automation-7.png"/>

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

Appium Desktop Installation and Configurations

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

download appium

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.)

appium-desktop-versions

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

install appium

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

appium-desktop-welcome-screen

Let’s click the “Advanced” tab and change the Server Address to “127.0.0.1” 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”.

appium-desktop-settings

Set Android and JAVA home in Appium Desktop.

android-home-settings

Give the required permission to Appium Server.

<a href=https://604223-1956433-raikfcquaxqncofqfm.stackpathdns.com/wp-content/uploads/2018/01/appium-install-3.png"/>

You will see the server up and running.

appium-desktop-working

Maven Configuration

How to configure Maven

WINDOWS

Step 1: System Requirements

Maven system requirements

Check if java is installed on your machine.

From the Command prompt, please enter "java -version" which will display the Java version installed on your local machine.

Step 2: You need to download the stable version of Maven from Click here to download Maven latest version

For Windows, system make sure you download Maven (Version) (Binary zip)

For Linux Machines, make sure you download Maven (Version) (Binary tar.gz)

Maven Downloads

Step 3: Extract the File, and place it in C: drive.

Rename the file from Apache Maven (version) to simple Maven for just usability.

C:\Program Files\Maven

Step 4: Once we have downloaded, all that we are now left to do before starting using MAVEN is set a couple of environment variables. To do that, right-click Computer >> Properties >> Advanced >> Environment Variables.

The second variable that we need to set up is the PATH variable, the reason we do this is that you can trigger the maven executable command from anywhere in your command prompt and it will point to the MAVEN executable which is in the BIN folder

Properties. [Note: You should have the admin access to the system]

Set Environment Variables

First, you need to set the new variable as "MAVEN_HOME" and provide the path where the Maven is stored in the C drive (as above mentioned C:\Program Files\Maven)

Add Environment Variable

Next, we need to add the bin folder to the Path. Select the Path in System variables and click on Edit.

Add the path of the Maven Build Folder as %MAVEN_HOME%/bin or simply as (C:\Program Files\Maven\bin).

Edit path Variable

Click on OK and Apply the Environment Variables.

Step 5: There we go, we are set and ready to hit MAVEN commands. So, firstly let's test to see if MAVEN is working fine. A simple MAVEN command is mvn --version.

Open Command Prompt and enter the command as mvn -version - It should display the version number as in the below screenshot.

maven version

MacOS

Use the following Homebrew command to install Maven:

brew install maven

Linux

Use the following command to install Maven:

sudo apt-get install maven

Install Node.js on Windows

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.

How to Download & Install Node.js - NPM on Windows

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.

How to Download & Install Node.js - NPM on Windows

Step 3: Continue with the installation steps

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

How to Download & Install Node.js - NPM on Windows

Step 4: Accept the terms and conditions

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

How to Download & Install Node.js - NPM on Windows

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.

  1. 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.

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

How to Download & Install Node.js - NPM on Windows

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

How to Download & Install Node.js - NPM on Windows

Step 7: Start the installation

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

How to Download & Install Node.js - NPM on Windows

Step 8: Complete the installation

Click the Finish button to complete the installation.

How to Download & Install Node.js - NPM on Windows

MacOS

  1. Open Terminal

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

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

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

npm -v

Linux

  1. Open Terminal

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

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

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

npm -v

Did this answer your question?