O'Reilly logo

Selenium 2 Testing Tools Beginner's Guide by David Burns

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Design Patterns

In this chapter we are going to have a look at good design patterns for creating maintainable and reusable bits of code that we can use with our Selenium tests. This means that if there are any changes needed to our web application or changes in the way we need to find elements, we can change it once and have it fix everything very quickly.

In this chapter, we shall learn:

  • Page Object design
  • Using Page Factory in Page Objects
  • Using LoadableComponents

So let's get on with it...

Important preliminary points

In this chapter it will be assumed that all files will have the following import statements:

import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required