S::R::D

Daniel Gempesaw f941088062 Bump version %!s(int64=11) %!d(string=hai) anos
lib c99dc710a7 Add $method to debug statements %!s(int64=11) %!d(string=hai) anos
t fe3b22d76c Merge pull request #134 from jamadam/add-notok-status %!s(int64=11) %!d(string=hai) anos
.gitignore 9bb5ed663e Add `dzil build` generated files to ignore %!s(int64=11) %!d(string=hai) anos
.mailmap fa8b6e3b2b Don't generate readme from pod %!s(int64=11) %!d(string=hai) anos
.travis.yml 111aff8321 Include associated perl version change in generated .travis.yml %!s(int64=11) %!d(string=hai) anos
Changes 3992d213f0 v0.2001 %!s(int64=11) %!d(string=hai) anos
README.md 8e3b4e0cbb Fix #137: Add non-cpanm details to Readme#installation %!s(int64=11) %!d(string=hai) anos
TAGS 01f49fa04a Add ctags file %!s(int64=11) %!d(string=hai) anos
cpanfile 2760a9b7f6 Update generated cpanfile with new deps from #103 %!s(int64=11) %!d(string=hai) anos
dist.ini f941088062 Bump version %!s(int64=11) %!d(string=hai) anos
driver-example.pl b6e79c1345 Changed line endings to Unix format. %!s(int64=12) %!d(string=hai) anos
ide-plugin.js b6e79c1345 Changed line endings to Unix format. %!s(int64=12) %!d(string=hai) anos
weaver.ini a969dc5d60 Replace redundant SeeAlso/Bug sections with [SeeAlso]/[Bugs] %!s(int64=11) %!d(string=hai) anos

README.md

Selenium::Remote::Driver

Build Status

Selenium WebDriver is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. This module is a Perl implementation of the client for the Webdriver JSONWireProtocol that Selenium provides.

This module sends commands directly to the server using HTTP. Using this module together with the Selenium Server, you can automatically control any supported browser. To use this module, you need to have already downloaded and started the standalone Selenium Server.

Installation

It's probably easiest to use cpanm:

$ cpanm Selenium::Remote::Driver

If you want to install from this repository, you have a few options:

With Dist::Zilla

If you have Dist::Zilla, it's straightforward:

$ dzil listdeps --missing | cpanm
$ dzil install

Without Dist::Zilla

If you don't want to use Dist::Zilla, we maintain a cpan branch that has a Makefile.PL that cpanm can install from:

$ cpanm -v git://github.com/gempesaw/Selenium-Remote-Driver.git@cpan

Or, if the git:// protocol is blocked or you don't want to use cpanm

$ git clone https://github.com/gempesaw/Selenium-Remote-Driver
$ cd Selenium-Remote-Driver
$ git checkout -b cpan origin/cpan
$ perl Makefile.PL

Viewing dependencies

You can also use cpanm to help you with dependencies after you've cloned the repository:

$ cpanm --showdeps .

Usage

NB: Problems with Webdriver 2.42.x ?

It appears that the standalone webdriver API changed slightly in 2.42.x versions. We're working on an update to address this, but in the meantime if you can continue using 2.41.x or less, that should keep your tests in running condition for the time being.

You'll need a Remote WebDriver Server running somewhere. You can download a selenium-standalone-server.jar and run one locally, or you can point your driver somewhere like Saucelabs.

Locally

use Selenium::Remote::Driver;

my $driver = Selenium::Remote::Driver->new;
$driver->get('http://www.google.com');
print $driver->get_title();
$driver->quit();

Saucelabs

use Selenium::Remote::Driver;

my $user = $ENV{SAUCE_USERNAME};
my $key = $ENV{SAUCE_ACCESS_KEY};

my $driver = Selenium::Remote::Driver->new(
    remote_server_addr => $user . ':' . $key . '@ondemand.saucelabs.com',
    port => 80
);

$driver->get('http://www.google.com');
print $driver->get_title();
$driver->quit();

There are additional usage examples on metacpan, and also in this project's wiki, including setting up the standalone server, running tests on Internet Explorer, Chrome, PhantomJS, and other useful example snippets.

Support and Documentation

Check out metacpan for the POD; alternatively, after installing, you can find documentation for this module with the perldoc command.

$ perldoc Selenium::Remote::Driver
$ perldoc Selenium::Remote::WebElement

Please file all bugs in the Github issue tracker.

Contributing

Thanks for considering contributing! The contributing guidelines are also in the wiki. The documentation there also includes information on generating new recordings via

$ perl t/bin/record.pl

Copyright and License

Copyright (c) 2010-2011 Aditya Ivaturi, Gordon Child

Copyright (c) 2014 Daniel Gempesaw

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.