O'Reilly logo

Selenium WebDriver Practical Guide by Satya Avasarala

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

Working on an end-to-end example of WordPress

Now that we have understood what PageObjects are, it is time to take a look at an end-to-end example that interacts and tests the WordPress Admin console. First, we will see all the PageObjects and then the test cases that use them.

Looking at all the PageObjects

Let us first see all the PageObjects that are involved in testing the WordPress Admin console.

The AdminLoginPage PageObject

The AdminLoginPage PageObject deals with the login page. This object has to be refactored if any changes have been made to the page in the target application, using the following code:

package com.packt.webdriver.chapter9.pageObjects; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.CacheLookup; ...

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