Selenium Framework Setup & Usage Guidelines
Required Software / Tools Specifications
Java
Selenium
Eclipse
Maven Configuration
GIT 2.4.1
Tortoise GIT
Android Studio
Appium
Node Js
Google Chrome
HOW TO INSTALL AND CONFIGURE
Install Java
WINDOWS
Follow the 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 the ‘Advanced’ tab as shown below:
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:
The below figure depicts the configuration of the environment variable name and value.
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.
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“.
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.
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. I prefer Darcula because it is better for the eyes but you can go with the white classical theme if you want.
Click the “Finish” button and install the required tools.
Then, just wait until all libraries are downloaded and the installation is 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 an administrator.
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.
Then, you need to add the 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 a little 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.
Appium Desktop Installation and Configurations
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 is downloaded, click run and start to install appium desktop.
When the installation is 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” 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.
Maven Configuration
How to configure Maven
WINDOWS
Step 1: 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)
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]
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)
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).
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.
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.
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
On 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
On 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.
MacOS
Open Terminal
Use the following Homebrew command to install Node & NPM:
brew install node
Execute the following command to ensure that Node has been installed, it should print the installed Node version:
node -v
Execute the following command to ensure that Node has been installed, it should print the installed NPM version:
npm -v
Linux
Open Terminal
Use the following command to install Node & NPM:
sudo apt-get install node
Execute the following command to ensure that Node has been installed, it should print the installed Node version:
node -v
Execute the following command to ensure that Node has been installed, it should print the installed NPM version:
npm -v