The AddNewPostPage PageObject

The AddNewPostPage PageObject deals with adding a new post to the blog, using the following code:

package com.example;import org.openqa.selenium.WebDriver;import org.openqa.selenium.WebElement;import org.openqa.selenium.support.FindBy;public class AddNewPostPage {    WebDriver driver;    @FindBy(id = "content_ifr")    WebElement newPostContentFrame;    @FindBy(id = "tinymce")    WebElement newPostContentBody;    @FindBy(id = "title")    WebElement newPostTitle;    @FindBy(id = "publish")    WebElement newPostPublish;    public AddNewPostPage(WebDriver driver) {        this.driver = driver;    }    public void addNewPost(String title, String descContent) {        newPostTitle.click();        newPostTitle.sendKeys(title);        driver.switchTo().frame(newPostContentFrame

Get Selenium WebDriver 3 Practical Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.