This article steps through a basic Selenium project, which tests a simple Login screen.


Project Files / Setup

The project files are available here:

Copy these files to your local computer, create a JUnit project (in Eclipse), and import these files.

This project relies on ChromeDriver, Java and JUnit.


The files in the project are:

Package File Description / Notes
HelperFunctions constants.java

This file contains a few hard-coded constants, and you will need to tweak this to fit with your system.  Specifically, the value:

// ChromeDriver location
public static final String chromeDriverPath = "/home/john/eclipse/chromedriver";

Change this to your local copy of your ChromeDriver file.

Pages loginPOM.java

This file contains the Page Object Model (POM) of the Login screen.  

This POM is used by the loginTests file.

Tests loginTests.java

This file contains the tests for the Login screen.

These tests are high-level tests which rely on the loginPOM.