Installation The Simple Way – Part 2

1_SXzqtB1jDTP46FJsPAnFew            download.png         zl48EuhC_400x400

We pick up were we left off with our installation guide. Next on the agenda will be to install Java, Maven and IntelliJ using Chocolatey.

Disclaimer – Please ensure that you gone through Installation The Simple Way first before continuing with this post.

First lets check that we do not have Java 8 installed (at the time of writing  JDK8 is the version of the Java environment being used for this post).

Open up the command line window in your Windows machine. You can simply enter the letters cmd in the search field located at the bottom left hand corner of the screen. Next on the screen enter the command “java -version”. Assuming that you have not had Java installed before the following message should appear in the command line window ‘java’ is not recognized as an internal or external command, operable program or batch file.

Screenshot 2020-07-28 at 18.39.45

Next we want to bring up a new PowerShell window. In the search field bar, type in PowerShell. Ensure that you are running the command line with admin rights.

In the window type in the following command  “choco  install  jdk8″. Chocolatey should now start to install the  JDK8 (Java Development Kit 8), more on the JDK in another post. Screenshot 2020-07-28 at 18.59.48

Now to ensure that we have successfully installed Java open a new command window and type the following command “java -version”.  You will be presented with the following text in the window “java version “1.8.0_211″ Java(TM) SE Runtime Environment (build 1.8.0_211-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)”

This would confirm that we have successfully installed java on our machine. Right one down ….two to go! Next up we shall install Maven our project dependency manager. First lets check that we do not have Maven installed, on the command line window enter the following command “mvn -version” if you do not have Maven installed you should be presented with the following text in the window “‘mvn’ is not recognized as an internal or external command, operable program or batch file.” 

Open the PowerShell window and type in the following command “choco install maven”. Remember to ensure the PowerShell is running as an admin. The window below should be displayed as Chocolatey installs Maven.

Screenshot 2020-07-28 at 20.05.36.png

 

We can see from the screenshot that Chocolatey successfully installed Maven. we can confirm this by heading over to a new command line window and typing the following command “mvn -version”. The following text should display “Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.6.3\bin\.. Java version: 1.8.0_211, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_211\jre Default locale: en_GB, platform encoding: Cp1252 OS name: “windows 10”, version: “10.0”, arch: “amd64”, family: “windows”  “

Screenshot 2020-07-28 at 19.25.14.png

We now have to install Intellij IDE our development environment. You can check if you have this installed by trying to search for the software in the windows search bar. If you do not have it installed please follow the next steps.

In the command PowerShell window enter the following command “choco install intellijidea-community”.  We are installing the community edition of Intellij as its free! The following script should be running as below in the screenshot.

Screenshot 2020-07-28 at 19.45.43

Now lets check that Intellij is now installed on the search bar by typing in “Intellij IDEA Community Edition 2020.1.4”. The following search results should display as per the screenshot below.

Screenshot 2020-07-28 at 19.50.01.png

We are now set to create our first basic automation test script. See you in next post!

 

Advertisement

Installation The Simple Way

install.png

 

When starting out with test automation one of the first things that is required will be to install various software components. This software will allow for us to create some automated tests.

For our first setup will be using the Java implementation of the Selenium API. The main parts of software that will be required are as follows:

Java –  Java is a programming language and computing platform first released in 1995. There are lots of applications and websites that use Java.

Maven -Maven is a dependency management and  build automation tool used primarily for Java projects.

IntelliJ IDEIntelliJ is an Integrated Development Environment used for computer software development.This is tool in which developers and QA can write code.

The software components mentioned above will be main pieces that we shall be using to get started. As we progress with getting started with Selenium and Java their usages will become more apparent.

When it comes to installing Java and Maven on a Windows or Mac machine this can prove very tricky. In the past this would require changes to things like the system variables and add various changes to the paths in the system. This could easily lead to human error and cause  lots of setup issue. I have had first hand experience of this.

Fortunately for both Windows and Mac users there are package managers that can do all of the labour intensive work of downloading what we require and performing all of the setup tasks.

The two package managers that I have used are Chocolatey (Windows based) and Homebrew(Mac OS based).

choco.png

homebrew-social-card.png

I shall start off with how to install Chocolatey for Windows. Window typically tends to be the most widely used operating system for business and users. I will in future put up a post about getting started with Homebrew.

You first want to open up the Windows PowerShell command line (you can search for this in the windows search bar) please ensure you open this as the window administrator you may face installation privileges issues when we start installing the software components  we require. You should see the following window below:

Screenshot 2020-07-08 at 15.44.31

With PowerShell, you must ensure Get-ExecutionPolicy is not restricted as mentioned on the chocolatey website.

Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.

The the next thing you want to is to copy the below command in the PowerShell window:

Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(‘https://chocolatey.org/install.ps1’))

The PowerShell screen should display as below. In the case of my setup I had to changed the execution policies as mentioned and this will be evident in the screenshot.

choco_install

Now if you don’t see any errors close down the PowerShell window reopen the window and type the following command ‘choco’ you should see the version number of Chocolatey and you have successfully installed Chocolatey on your Windows machine.

Screenshot 2020-07-08 at 16.15.03

In the next post we will be actually using Chocolatey to install Maven, Java and Intellij.

See you in the next post!