clean_selenium_script assistance
Posted: Fri Jan 30, 2015 4:28 pm
OS: CentOS 64-bit
Software: Nagios XI install running on vmware.
Hello, I need some assistance with "clean_selenium_script" referenced in document (/nagiosxi/docs/Integrating-Selenium-With-Nagios-XI.pdf ) i am running this against an selenium IDE exported perl file per the doc.
The problem occurs when running the previously "tidy'd" script with the following
The test works from start to end under selenium IDE.
Kind Thanks,
Dale Sallis
Systems Administrator
Llamasoft
Software: Nagios XI install running on vmware.
Hello, I need some assistance with "clean_selenium_script" referenced in document (/nagiosxi/docs/Integrating-Selenium-With-Nagios-XI.pdf ) i am running this against an selenium IDE exported perl file per the doc.
Code: Select all
use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
use TimePerf2;
my $time= TimePerf2->new(60,90,120);
my $sel = Test::WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*firefox",
browser_url => "https://www.supplychainguru.com/" );
$time->startTime("ALL");
$sel->set_timeout_ok("30000");
if ( ! $sel->open_ok("/Authentication/LogOn?ReturnUrl=%2f") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->set_speed("1500") ) { }
elsif ( ! $sel->type_ok("id=UserNameOverlay", "User Name") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->type_ok("id=UserName", "jeeves\@scguru.hostedservices.com") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->type_ok("id=Password", "*hidden*") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("css=input.sign-in-scg-com") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(3000);
elsif ( ! $sel->click_ok("css=a[title=\"LoadTestModel\"] > div.recent-item-name") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(3000);
elsif ( ! $sel->click_ok("link=Default") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(3000);
elsif ( ! $sel->click_ok("css=div.model-item") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(3000);
elsif ( ! $sel->click_ok("css=#view-selected-map > span.sprite") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(5000);
elsif ( ! $sel->click_ok("id=add-layer") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(5000);
elsif ( ! $sel->type_ok("css=div.editor-field > #Name", "test1") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("id=create-layer-submit") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(3000);
elsif ( ! $sel->click_ok("id=add-layer") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(3000);
elsif ( ! $sel->type_ok("css=div.editor-field > #Name", "test2") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->select_ok("id=DataSource", "label=Sites") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("id=create-layer-submit") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(5000);
elsif ( ! $sel->click_ok("css=#delete > span.sprite") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("//button[\@type='button']") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(5000);
elsif ( ! $sel->click_ok("css=#delete > span.sprite") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("//button[\@type='button']") ) {print "Location: " . $sel->get_location() . "\n";}
$sel->pause(5000);
elsif ( ! $sel->click_ok("link=Home") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( !$time->endTime("ALL") ) { }
else { $time->getTimes(); }
$sel->stop();
I've taken a look at line 31 and around the elseif statement however i am no perl expert and am unsure how the clean selenium script is breaking it.syntax error at checkmaps.edited line 31, near "elsif"
Execution of checkmaps.edited aborted due to compilation errors.
# Looks like your test exited with 255 before it could output anything.
The test works from start to end under selenium IDE.
Kind Thanks,
Dale Sallis
Systems Administrator
Llamasoft