How to setup your Intellj IDEA project for Selenium web driver

Chalitha
2 min readJan 7, 2021

This peace of writing will help you to understand the basic steps to follow when you are setting up an Intellj project to write selenium code.

Pre requisites

You need to configure your IDE with support of selenium. for demonstration purpose I am using Intellj IDEA community 2020.3

Setting up the Project

  1. create a maven project
  2. Pick any name for the project and finish it.
  3. Open the pom.xml in the project
  4. Include additional libraries that we will use in the project. These information includes in the Dependencies section of the pom.xml
sample pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>Guru1</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>15</maven.compiler.source>
<maven.compiler.target>15</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>compile</scope>
</dependency>
</dependencies>

</project>

Post Requisites

Once you done with the pom.xml ,please execute below two steps to verify the addition of external libraries.

  1. Click on the external Libraries section of the Maven project. You should be able to see downloading libraries start with M in the following image.
External libraries

2. Make sure you have download the latest version of these libraries in order to avoid the future conflicts.

Now you have completed the process of setting up your project to support selenium web driver.

--

--