Chapter 9

  1. How do you initialize a PageObject implemented with PageFactory?

PageFactory.initElements(driver, pageObjectClass).

  1. Using which class can we implement methods to validate whether the page is loaded?

LoadableComponent.

  1. Which By class methods are supported by @FindBy?

ID, Name, ClassName, TagName, Link, PartialLinkText, CSS Selector, and XPATH.

  1. While using PageFactory, if you name the WebElement variable name by the same ID or name attribute, then you don't need to use the @FindBy annotation: True or false?

True. You can declare the WebElement variable with the same name as the value of id or name attribute, PageFactory will resolve it without using the @FindBy annotation

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.