Launching the Selenium Grid Hub

Problem We want to start Selenium HUB, which is the central point in the Grid that will receive all Selenium commands and route them to the right node. Prerequisites Download the latest version of selenium-server-standalone.jar […]

Selenium Grid introduction

Selenium Grid allows us to have multiple Selenium instances on multiple machines and then have one point to send Selenium commands to. We can specify the operating system / browser and browser version where we […]

Running tests on an Android simulator

Problem The android driver allows us to execute our tests against an Android browser. This can be a simulator or a real device. This recipe will walk us through the steps we have to do […]

Run tests on a real Android device

Problem We want to run our testscripts on a real Android device. The android driver allows us to execute our tests against an Android browser. This can be a simulator or a real device. Prerequisites […]

Run test scripts against a real iPhone device

Problem We want to execute our testscripts on a iphone device. The iphone driver allows us to execute the WebDriver tests on a real iphone device. Prerequisites We need to install Xcode which is available […]

Run test scripts on a Xcode iPhone simulator

Problem We want to run our test in a iPhone simulator. The iphone simulator comes with Xcode which is available for the Mac operating systems. This recipe will show us how we can run our […]

Perform a sequence of actions with Selenium WebDriver

Problem We want to perform multiple actions in once, like: drag-and-drop, sliding, selecting multiple items. Solution The example code below shows some examples where we can use the Actions interface of Selenium WebDriver. <code lang="java"> […]

Control a selectbox or dropdownbox with Selenium WebDriver

Problem We want to select and deselect selectbox options with Selenium WebDriver. Solution The example code below shows the variety of methods we can use to control a selectbox. We can also determine if we […]

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

Implement code timings

Problem The easiest way to get some performance related metrics is to implement timings in your testcode. This will work in every browser which is the big advantage. The disadvantage is probably that we have […]

Implement web.Timings

Problem A new embedded feature in some browsers is the webtimings. This feature works only in Internet Explorer 9 and Google Chrome, by the time this book is published. We can also combine it with […]