WWW::Selenium::Utils::CGI - helper functions Selenium CGIs
# simple CGI script use WWW::Selenium::Utils::CGI qw(run); use CGI; print run( CGI->new() );
This package contains useful functions for creating test scaffolding CGI scripts that Selenium can use. Users of this module will need to create their own cgi or mod_perl handlers that call these functions.
These subs should be called by CGI or mod_perl wrappers. I feel this will provide the most generic interface that can be customized to any application. Sample CGI scripts are in scripts/ of this distribution. Indeed I use both CGI and mod_perl for various test projects.
run() will run an command passed in from as a CGI variable.
run()
Note that this is NOT SAFE for general websites, as it allows ARBITRARY COMMANDS to be run. For testing purposes however, it is quite useful.
HTTP GET Parameters:
The command to execute. Note that you will need to properly encode commands in your selenium test cases, like this:
/open /selenium/run.cgi?cmd=ls%20-l
cat() will output the contents of a file.
cat()
Arguments:
The base directory when a relative path is used. Defaults to perl's install prefix.
The file to read. If the file does not begin with a '/', then the file will be relative to $Config{prefix} (where your perl is installed to).
If this is false (the default), then the contents of the file will be surrownded in a pre block, to make the output look nicer in the browser.
Keeps any kind of key/value state. This can allow selenium to signal other processes or stare information. State is stored in a flat file in /tmp.
A key to set or get.
If present, will be stored for the given key.
None.
Uses CGI.
There are no known bugs in this module. Please report problums to Luke Closs (cpan@5thplane.com). Patches are welcome.
Luke Closs (cpan@5thplane.com)
Copyright (c) 2005 Luke Closs (cpan@5thplane.com). All rights reserved.
This module is free software; you can redstribute it and/or modify it under the same terms as Perl itself. See perlartistic.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To install WWW::Selenium::Utils, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Selenium::Utils
CPAN shell
perl -MCPAN -e shell install WWW::Selenium::Utils
For more information on module installation, please visit the detailed CPAN module installation guide.