Skip to content
Browse files

Using the Selenium server instead of the Selelium IDE

  • Loading branch information...
dannymk committed Jul 2, 2012
1 parent cacc744 commit a9037d6a22a8d3489887f448a8391058c1659ab1
Showing with 107 additions and 9 deletions.
  1. +37 −8 selenium/README
  2. +1 −1 selenium/login.html
  3. +69 −0 selenium/
@@ -1,20 +1,49 @@
danny_mk, yeah. the best thing you could do is make a branch for the selenium work that doesn't have any other commits in it for other stuff
scrottie git branch selenium; git checkout selenium
scrottie git cherry-pick b8596fd10da910254150db02dc7336bda5a25c89 # to bring over the one commit that you did
scrottie then to push that: git push origin selenium

Install WebGUI using to the instructions at:

Create the following settings in your test site webgui.conf file:

"selenium" : {
"server" : "localhost",
"port" : "4444",
"browser" : "firefox",
"webgui_url" : "http://your_webgui_test_site_url"

Make sure you select all the defaults (do not change the "admin" user password)

Pick the site design: "Style 03" (This is the style selected for testing)

Download the Selenium server from:
as of this writing it was selenium-server-standalone-2.24.1.jar

Running the Selenium Server (run in a separate command line/window)
java -jar selenium-server-standalone-2.24.1.jar

The -browserSessionReuse is to keep the selenium session open so you may troubleshoot page issues
The Selenium software automatically closes the browser when the tests are concluded. If you are writing/troubleshooting tests
and need the browser to remain open use:
java -jar selenium-server-standalone-2.24.1.jar -browserSessionReuse

If running the selenium tests in the IDE make sure to change:
<link rel="selenium.base" href="" /> TO: <link rel="selenium.base" href="http://your_webgui_test_site_url" />

Selenium server not running (this may vary according to the values in your webgui.conf file):
Error requesting http://localhost:4444/selenium-server/driver/:
500 Can't connect to localhost:4444 (Connection refused)


Download and install the Selenium IDE from:

Take a look at the Selenium IDE documentation:

Youtube videos can be quite handy:

Use the Selenium IDE to open the test suites:

Change: <link rel="selenium.base" href="" /> TO: <link rel="selenium.base" href="http://your_test_website" />
@@ -3,7 +3,7 @@
<html xmlns="" xml:lang="en" lang="en">
<head profile="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
<link rel="selenium.base" href="" />
@@ -0,0 +1,69 @@
use Test::More tests => 98;
use Test::WWW::Selenium;
use Test::WWW::Selenium::HTML;
use WebGUI::Paths -inc;
use WebGUI::Config;
use strict;

WebGUI::Paths->siteConfigs or die "no configuration files found";

my $config = undef;
my $webguiSiteUrl = undef;
my $browser = undef;
my $seleniumServer = undef;
my $seleniumServerPort = undef;
if ( my $config_file = $ENV{WEBGUI_CONFIG} ){
my $webguiTestConfigFilename = WebGUI::Paths->configBase . '/' . $config_file;
$config = WebGUI::Config->new( $webguiTestConfigFilename ) or die "failed to load configuration file: $webguiTestConfigFilename: $!";

$webguiSiteUrl = $config->{config}->{selenium}->{webgui_url};
$browser = $config->{config}->{selenium}->{browser}; # firefox, iexplore, safari
$seleniumServer = $config->{config}->{selenium}->{server};
$seleniumServerPort = $config->{config}->{selenium}->{port};

} || die "Can't get Selenium configuration values from configuration file: $webguiTestConfigFilename\n";

die "Please read the instructions, you must specify a PERL5LIB and WEBGUI_CONFIG file value!\n";


my $sel = Test::WWW::Selenium->new(
host => $seleniumServer,
port => $seleniumServerPort,
browser => "*$browser",
browser_url => $webguiSiteUrl );

my $selh = Test::WWW::Selenium::HTML->new( $sel );


#------------------------- Run All Tests here -----------------------

ok(1, "Login test");
$selh->run(path => "login.html");
ok(1, "Turn On Admin test");
$selh->run(path => "turnOnAdmin.html");
ok(1, "Admin Console tests");
$selh->run(path => "turnOnAdmin.html");
ok(1, "Version Tags tests");
$selh->run(path => "versionTags.html");
ok(1, "Clipboard test");
$selh->run(path => "clipboard.html");
ok(1, "Asset Helpers tests");
$selh->run(path => "assetHelpers.html");
ok(1, "New Content->Basic tests");
$selh->run(path => "newContentBasic.html");
ok(1, "New Content->Community tests");
$selh->run(path => "newContentCommunity.html");
ok(1, "New Content->Intranet tests");
$selh->run(path => "newContentIntranet.html");
ok(1, "New Content->Prototypes tests");
$selh->run(path => "newContentPrototypes.html");
ok(1, "New Content->Shop tests");
$selh->run(path => "newContentShop.html");
ok(1, "New Content->Utilities tests");
$selh->run(path => "newContentUtilities.html");

0 comments on commit a9037d6

Please sign in to comment.
You can’t perform that action at this time.