S::R::D

Daniel Gempesaw c6082f62d5 v0.18 11 năm trước cách đây
lib 8845a978fd Avoid indirect object instantiation syntax 11 năm trước cách đây
t 874a1e5d54 Fix #116: tests failed on some platforms due to use_ok and skip_all 11 năm trước cách đây
.gitignore 9bb5ed663e Add `dzil build` generated files to ignore 11 năm trước cách đây
.travis.yml 111aff8321 Include associated perl version change in generated .travis.yml 11 năm trước cách đây
Changes ba2208191c Interweave new changes to align with previous formatting 11 năm trước cách đây
README.md e86f146632 Add travis build status for master branch 11 năm trước cách đây
TAGS 01f49fa04a Add ctags file 11 năm trước cách đây
dist.ini c6082f62d5 v0.18 11 năm trước cách đây
driver-example.pl b6e79c1345 Changed line endings to Unix format. 12 năm trước cách đây
ide-plugin.js b6e79c1345 Changed line endings to Unix format. 12 năm trước cách đây

README.md

Selenium::Remote::Driver

Build Status

Selenium WebDriver is an open source project that exposes an API for browser automation, among other things. 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 it, 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 driver at Saucelabs and let them handle the it.

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.

There is a short script that will handle the environment variable and generate recordings for you:

$ perl t/bin/generate-recordings.pl

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 in the Github issue tracker.

You can also find some supporting docs in the Github 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.