NAME
Selenium::PageObject - Selenium's PageObject pattern in Perl. Now your module @ISA pageObject!
VERSION
version 0.012
SYNOPSIS
package ExamplePageObject;
use base qw{Selenium::PageObject};
sub do_something_cool_returning_an_element {
my $self = shift;
return $self->getElement('radElement','id');
}
1;
DESCRIPTION
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) - Specification 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) - Specification 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 blur the current element (useful for lose focus listeners, etc).
SEE ALSO
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.
SPECIAL THANKS
cPanel, Inc. graciously funded the initial work on this Module.
AUTHOR
George S. Baugh <teodesian@cpan.org>
CONTRIBUTOR
Neil Bowers <neil@bowers.com>
SOURCE
The development version is on github at http://github.com/teodesian/Selenium-PageObjects-Perl and may be cloned from git://github.com/teodesian/Selenium-PageObjects-Perl.git
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.