WWW::Selenium::Utils::CGI - helper functions Selenium CGIs


WWW-Selenium-Utils documentation  | view source Contained in the WWW-Selenium-Utils distribution.

Index


NAME

Top

WWW::Selenium::Utils::CGI - helper functions Selenium CGIs

SYNOPSIS

Top

  # simple CGI script
  use WWW::Selenium::Utils::CGI qw(run);
  use CGI;
  print run( CGI->new() );

DESCRIPTION

Top

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.

SUBROUTINES

Top

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

run() will run an command passed in from as a CGI variable.

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:

cmd

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

cat() will output the contents of a file.

Arguments:

basedir

The base directory when a relative path is used. Defaults to perl's install prefix.

HTTP GET Parameters:

file

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).

raw

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.

state

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.

HTTP GET Parameters:

key (Mandatory)

A key to set or get.

value

If present, will be stored for the given key.

DIAGNOSTICS

Top

None.

DEPENDENCIES

Top

Uses CGI.

BUGS AND LIMITATIONS

Top

There are no known bugs in this module. Please report problums to Luke Closs (cpan@5thplane.com). Patches are welcome.

AUTHOR

Top

Luke Closs (cpan@5thplane.com)

LICENCE AND COPYRIGHT

Top


WWW-Selenium-Utils documentation  | view source Contained in the WWW-Selenium-Utils distribution.