Automated UI test with Selenium-RC, WWW::Selenium and Test::More

use WWW::Selenium;
use Test::More tests => 2;  #update to reflect the number of tests to be run

my $sel = WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*iexplore",  # *iehta has more cross-domain privileges than *iexplore
browser_url => "http://mysite.com",
);
$sel->start();
$sel->open("http://mysite.com/testpopup.html");
diag("Check whether the popup is hidden.");
my $canSeePopup = $sel->is_visible("modalWindow");
ok ($canSeePopup == 0, "Popup is not visible.");
diag("Check whether the magic is hidden.");
ok(
$sel->is_visible("modalWindowMagicLayer") == 0,
"CSS magic is hidden... for now."
);
$sel->stop();;

source

Leave a Reply