Expose methods

We can expose methods in order to reduce duplicated code. We are able to call the method multiple times. This will ensure a better maintainable test code, because we only have to make adjustments and […]

Locators – Introduction

Locators are the way to tell Selenium with which web element we like to do something (It can be anything, like: clicking, typing, selecting, verifying, etc.). Selenium provides different ways of locating those web elements; […]

Dealing with moving focus

Problem Imagine the following situation: after accepting a confirmation dialog you will be redirected to another page. This recipe will explain how to deal with this inevitable situation. Prerequisites We have made a class file […]

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

Measure Performance – Introduction

We can measure the websites performance using Selenium WebDriver. There are a couple of ways to improve the performance of the application under test, but first we need to know where the bottleneck is. For […]

Page Object Model – Introduction

Creating Selenium test cases can result in an unmaintainable project. One of the reasons is that too many duplicated code is used. Duplicated code could be caused by duplicated functionality and this will result in […]

Locating sibling elements

Sibling elements do have something special in common, specifically they share the same parent. We can use this type of selector if one of the siblings doesn’t have an unique identifier. The following HTML code […]

Locating table cells

In the past tables were used to structure (lay-out) the entire page. There are many disadvantages with using tables, like they use more bytes of markup, they prevent incremental rendering, tables break text while copying, […]

Locating dynamic elements

Some websites will dynamically render the web page elements. It can be a huge challenge to select those elements. There are a couple of ways to locate those elements. In this example we will see […]

Validating the located element

Sometimes the HTML code of an given application is really unstructured and unreadable. That makes it hard to locate the web-page elements. Therefore it could be useful to validate the located element to see if […]