Page Objects

Submitted by: Submitted by

Views: 71

Words: 391

Pages: 2

Category: Business and Industry

Date Submitted: 09/07/2014 12:52 PM

Report This Essay

Page Object Pattern is a pattern that displays user interface as a class. In addition to user interface, functionality of the page is also described in this class. This provides a bridge between page and test.

Page factory: t

This is a Factory class that makes Page Objects simpler and easier to use.

PageFactory.initElements(driver, HomePage.class);

- This will Instantiate an instance of the given class.It will also List the fields that have been declared. This method instantiate the class given to it, using a constructor which takes a WebDriver instance as its only argument.

@FindBy

This is used to mark a field on a Page Object to indicate a mechanism for locating the element or a list of elements.

Webdriver:

WebDriver is a tool for automating testing web applications, and in particular to verify that they work as expected. It acts just as a normal Java library does

Explicit waits

An explicit waits is code you define to wait for a certain condition to occur before proceeding further in the code. 

Example

wait.until(ExpectedConditions.elementToBeClickable(By.id("someid")));

Implicit Waits

An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available.

JBEHAVE:

JBehave is a framework for Behaviour-Driven Development (BDD).It has five steps:

* Write Story

* Map Steps to Java

* Configure Stories

* Run Stories

* View reports

TESTNG:

TestNG is a testing framework inspired from JUnit 

Junit

JUnit is a unit testing framework.

Selenium:

Selenium is a portable software testing framework for web applications

It provides a record/playback tool for authoring tests

UNIT Testing practices:

* Automatic : Invoking of tests as well as checking results for PASS/FAIL should be automatic

* Thorough: Coverage; Although bugs tend to cluster around certain regions in the code, ensure that you test all key paths...