Test-WWW-Selenium is a perl driver and test library for Selenium Remote Control (SRC). You will need to setup a Selenium Server that can launch browsers.
This module sends commands directly to the Server using simple HTTP GET/POST requests. 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 Selenium Server. (The Selenium Server is a Java application.)
The Selenium Server is available here:
or on CPAN in the Alien-SeleniumRC package:
perl Makefile.PL make make test make install
Once installed, your test script will look something like this:
#!/usr/bin/perl use strict; use warnings; use Test::More tests => 4; use Test::WWW::Selenium; my $sel = Test::WWW::Selenium->new( host => "localhost", # where selenium-server is running browser => "*firefox", # browser to server should launch browser_url => "http://your.site"); $sel->open("http://your.site"); $sel->title_is('Super Cool Mega Site!'); $sel->text_is('todays_awesomeness', '100'); $sel->text_like('status', qr/returned 42 results/);
Other contributors: Dan Dascalescu, Scott McWhirter.
lib/WWW/Selenium.pm comes from the Selenium-RC project, which releases it under the Apache License, Version 2.0.
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.