Skip navigation links

TestNG Selenium 0.6.1 API

Getting Started

See: Description

Packages 
Package Description
com.github.jsdevel.testng.selenium  
com.github.jsdevel.testng.selenium.annotations.driverconfig  
com.github.jsdevel.testng.selenium.annotations.drivers  
com.github.jsdevel.testng.selenium.annotations.screensizes  
com.github.jsdevel.testng.selenium.exceptions  

Getting Started

First thing you need to do is get testng-selenium on your class path.
For maven users it's as easy as adding this to your dependencies:

In each of your suite classes, extend AbstractSuite like this:

AbstractSuite provides suites with a getPageFactory method to create the page factories passed in as a type parameter. In this example, the page factory passed as a generic type on line 7 is returned by getPageFactory.
Now let's look at MyPageFactory:

Each method declared in a PageFactory should return a sub class of Page. This allows testng-selenium to initialize your page objects, by doing some cool things, like navigating to them when WebDriver has been created. See Page Initialization for more details.
Ok, back to this page factory business. How is testng-selenium able to construct a page factory from an interface? Simple, Dynamic Proxies.

Page Initialization

Skip navigation links

Copyright © 2015. All rights reserved.