Setup Environment For Selenium


Before starting to setup things lets lets clearify our requirements for the setup and the course

  • We want to be able to write Selenium scripts but not individual scripts, but with a more organized and robust structure
  • We will be using Java as the main programming language for writing the scripts, so the latest jdk will be required
  • A build/testing tool, so we will be using Maven for the purpose with ofcourse Junit
  • Based on the target web browser we might need to download different WebDriver executables(Firefox does not need any WebDriver)


After installing Java and Maven just follow these steps:

  • Create a folder and inside that create a pom.xml file which can have the following content:
  • <project xmlns="" xmlns:xsi=""
  • From the command prompt simply go to the same directory where the pom.xml file is and run the following command: mvn clean install
    It will read the pom.xml file and download all the dependencies for you
  • After finishing you can see the traget directory created
  • Create the following directory structure right next to the target directory, notice that the structure should be similar to the groupId specified in the pom.xml
         |  |----java
         |  |--------org
         |  |-----------learning
         |  |-------------------asl
         |  |----------------------selasl
  • The main directory is where we will put our non-script files like PageObjects, helper classes and other utils.
  • In the test directory we will put our test scripts

Now everything is setup up and good to go next we will write a simple selenium script and try to understand its working. We will start with a Simple Selenium Webdriver Example.


2 thoughts on “Setup Environment For Selenium

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s