The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Selenium::PageObject - Selenium's PageObject pattern in Perl. Now your module @ISA pageObject!

SYNOPSIS

This module is intended to be a base for PageObjects. It abstracts a good deal of the things required to get/set various page inputs, and provides callback hooks so you can do special things like wait for JS. It also is driver agnostic -- use WWW::Selenium or Selenium::Remote::Driver if you want. I recommend Selenium::Remote::Driver due to it having a more complete feature set.

Refer to the other module in this distribution Selenium::Element for the rest.

CONSTRUCTOR

new(driver,uri)

Create a new PageObject using the provided driver, and navigate to the provided URI. If you have subclassed your driver, you will need to override this method to not do it's strict driver class checks.

INPUTS:

DRIVER (WWW::Selenium or Selenium::Remote::Driver) - The driver object

URI (STRING) - the page this object should fiddle with (saved as $self->{'page'})

OUTPUT:

  new Selenium::PageObject object

UTILITY

driver

The base selenium driver is available to you here.

GETTERS

getElement(SELECTOR,SELECTORTYPE)

Get the first element matching the provided selector and selector type. Refer to your driver's documentation as to valid types.

INPUTS:

SELECTOR (STRING) - Instructions for finding some element on the page

SELECTORTYPE (STRING) - Specifiation by which above instructions are parsed

OUTPUT:

  new Selenium::Element object

getElements(SELECTOR,SELECTORTYPE)

Get the elements matching the provided selector and selector type. Refer to your driver's documentation as to valid types. WWW::Selenium is designed to work with single elements, so this method will fail when using it. Consider refining your selectors and looping instead.

INPUTS:

SELECTOR (STRING) - Instructions for finding some element on the page

SELECTORTYPE (STRING) - Specifiation by which above instructions are parsed

OUTPUT:

  array of new Selenium::Element objects

GLOBAL EVENTS

tab

Send a tab to the page, to test tab navigation, or to de-focus the current element (useful for lose focus listeners, etc).

SEE ALSO

WWW::Selenium

Selenium::Remote::Driver

https://code.google.com/p/selenium/wiki/PageFactory for info about PageFactories, like this

https://code.google.com/p/selenium/wiki/PageObjects for more info about page objects themselves.

AUTHOR

George S. Baugh <teodesian@cpan.org>

SPECIAL THANKS

cPanel, Inc. graciously funded the initial work on this Module.

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by George S. Baugh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.