Useful Eclipse shortcuts

4.5 02 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 […]

Add logging to your test

0.0 00 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 […]

Introducing pre and post methods

0.0 00 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 […]

Execute your test

0.0 00 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 […]

Assert your result

0.0 00 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 […]

Write your test

4.0 01 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. […]

Project structure

3.0 02 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 […]

Add dependencies to your project

0.0 00 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 […]

Create a project

0.0 00 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 […]

Setting up Eclipse

0.0 00 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 […]

Locating child elements

2.8 22 A frequently used element which can have children is the list element. There are different kinds of list elements, like: definition list <df>, ordered list <ol> and unordered list <ul>. Each list item […]

Locating elements by attribute

0.0 00 In this example we will see how we can locate HTML elements based on their attributes. HTML elements can have multiple attributes, which are defined in the start element. An attribute always consist […]

Locating elements by tag

0.0 00 The HTML language consists of a set of markup tags to describe web pages. Generally speaking we call them HTML tags. HTML tags are surrounded by angle brackets and they normally come in […]

Access in-browser Development Tools

0.0 00 Most common browsers have some built-in development tools. These tools will help you to reveal the page and understand how the page is structured. This all sounds good, but they all have their […]

Using the favorites plugin

0.0 00 We may have generated a lot of test suites for a single or multiple projects. It could be helpful to have quick access to frequently used test suites. In this case the favorites […]