S::R::D

gempesaw 516c32d3b2 Switch to markdown readme and add usage section 11 vuotta sitten
lib 49580d5bdf Merge pull request #81 from gempesaw/async-script-callback 11 vuotta sitten
t c52f2bc9b2 Add OS X recordings for b36b317 (test-SRD tests failing :() 11 vuotta sitten
.gitignore 4e59c475f8 Adding Module::Install back in...don't know why I keep deleting it :( 14 vuotta sitten
Changes 0d08dc7a09 Add a number of more element-centric testing methods to Test::Selenium::Remote::Driver 12 vuotta sitten
README.md 516c32d3b2 Switch to markdown readme and add usage section 11 vuotta sitten
dist.ini 6218e358ba Handle encoding issues brought about by dist zilla v5 11 vuotta sitten
driver-example.pl b6e79c1345 Changed line endings to Unix format. 12 vuotta sitten
ide-plugin.js b6e79c1345 Changed line endings to Unix format. 12 vuotta sitten

README.md

Selenium::Remote::Driver

Selenium WebDriver is an open source project that exposes an API for browser automation. Selenium::Remote::Driver is a set of Perl bindings to that API that allow you to write automated browser tests in Perl, taking advantage of Selenium's strong ecosystem.

Installation

cpanm Selenium::Remote::Driver

To install from this repository, clone the repo, get Dist::Zilla, and:

dzil installdeps --missing | cpanm
dzil install

Usage

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 job at Saucelabs and let them handle the Remote WebDriver.

Locally

use Selenium::Remote::Driver;

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

Unit Tests

This module uses LWP::Protocol::PSGI to facilitate unit tests. LWP::Protocol::PSGI overrides the LWP HTTP/HTTPS & this allows us to "mock" the interaction with WebDriver Server. In regular instances you should be running the tests against the mocked recording, which are stored in t/mock-recordings. If you want to run the tests live against the WebDriver server, set an environment variable WD_MOCKING_RECORD to 1. This will force the unit tests to run tests against the WebDriver server & also save the traffic (request/response) in t/mock-recordings. Either reset the environment variable or set it to 0 to revert to mocking the traffic.

Support and Documentation

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 for this module at:

https://github.com/gempesaw/Selenium-Remote-Driver/issues

You can also find some supporting docs at:

https://github.com/gempesaw/Selenium-Remote-Driver/wiki

LICENSE AND COPYRIGHT

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

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.