Useful Eclipse shortcuts

I listed the most useful and frequently used shortcuts in Eclipse. Shortcut Explanation CTRL + 1 Shows quick fixes for common issues, like missing semi colons, import issues, missing declarations. CTRL + Shift + O […]

Add logging to your test

We can implement a flexible logging system, called log4j. With log4j we can make use of six levels of logging. Every log level can be treated differently. We can make the following distinction between log […]

Introducing pre and post methods

Introducing pre and post methods In the previous test script you can see that we opened and closed the browser from within the test. You can imagine that we have to do this for every […]

Execute your test

Explain why we would like to run our tests outside of eclipse. Use Eclipse to execute your tests We can use the Eclipse to run the tests, via right-click on the test class or method […]

Assert your result

TestNG provides some assertions. In this section you will see how to apply them. In practice The previous test will look like this when we add an assertion. <code lang="java"> import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import […]

Write your test

To write a tests with TestNG we have to annotate methods or classes with the @org.testng.annotations.Test annotation. Annotations on class level mean that all public methods within the class are considered test methods. Annotations on […]

Project structure

It is usefull to put the actual test scripts in the src/test/java source folder and all the framework code in the src/main/java source folder. The difference between packages / classes and methods is explained in […]

Add dependencies to your project

There are two ways of adding dependencies as well. You have to select the same method (manual or Maven) that you used to create the project in previous section. Add manual dependencies Download the Java […]

Create a project

There are two ways of creating a project. You can do it either with maven (build manager) or without. I will explain both ways in this tutorial. Normal project creation Create a Java project by […]

Setting up Eclipse

Eclipse is an Integrated Development Environment (IDE) mainly used for Java programming. Eclipse is open source and can be extended with additional plug-ins. Those plug-ins can be used through the entire software development cycle. By […]

Implementing a Testing Framework Introduction

This chapter will cover all the basic things we need to know when creating a new test automation project. By the end of this chapter you should be able to set up a basic testing […]