Skip to content
This repository
Newer
Older
100644 68 lines (47 sloc) 2.369 kb
17b61f52 »
2006-10-18 Initial checkin of Test-WWW-Selenium-1.04 from CPAN tarball
1 Test-WWW-Selenium is a perl driver and test library for Selenium Remote
2 Control (SRC). You will need to setup a Selenium Server that can launch
3 browsers.
4
5 Selenium Remote Control (SRC) is a test tool that allows you to write
6 automated web application UI tests in any programming language against
7 any HTTP website using any mainstream JavaScript-enabled browser. SRC
8 provides a Selenium Server, which can automatically start/stop/control
9 any supported browser. It works by using Selenium Core, a pure-HTML+JS
10 library that performs automated tasks in JavaScript; the Selenium
11 Server communicates directly with the browser using AJAX (XmlHttpRe-
12 quest).
13
14 This module sends commands directly to the Server using simple HTTP
15 GET/POST requests. Using this module together with the Selenium
16 Server, you can automatically control any supported browser.
17
18 To use this module, you need to have already downloaded and started the
19 Selenium Server. (The Selenium Server is a Java application.)
20
21 The Selenium Server is available here:
22
23 http://www.openqa.org/selenium-rc/
24
25 or on CPAN in the Alien-SeleniumRC package:
26
27 http://search.cpan.org/dist/Alien-SeleniumRC
28
29 To install:
30
31 perl Makefile.PL
32 make
33 make test
34 make install
35
36 Once installed, your test script will look something like this:
37
38 #!/usr/bin/perl
39 use strict;
40 use warnings;
41 use Test::More tests => 4;
42 use Test::WWW::Selenium;
43
44 my $sel = Test::WWW::Selenium->new( host => "localhost", # where selenium-server is running
45 browser => "*firefox", # browser to server should launch
46 browser_url => "http://your.site");
47
48 $sel->open("http://your.site");
49 $sel->title_is('Super Cool Mega Site!');
50 $sel->text_is('todays_awesomeness', '100');
51 $sel->text_like('status', qr/returned 42 results/);
52
53
54 Copyright (c) 2006 Luke Closs <lukec@cpan.org>.
55 Copyright (c) 2006 Dan Fabulitch <dfabulich@warpmail.net>.
56 Copyright (c) 2005, 2006 Mattia Barbon <mbarbon@cpan.org>.
57
5fab0f81 »
2009-08-31 add contributors
58 Other contributors: Dan Dascalescu, Scott McWhirter.
59
17b61f52 »
2006-10-18 Initial checkin of Test-WWW-Selenium-1.04 from CPAN tarball
60 lib/WWW/Selenium.pm comes from the Selenium-RC project, which releases
61 it under the Apache License, Version 2.0.
62
63 http://www.apache.org/licenses/LICENSE-2.0
64
65 This package is free software; you can redistribute it and/or
66 modify it under the same terms as Perl itself.
67
Something went wrong with that request. Please try again.