Selenium send_keys_ok method unknown in Perl
Posted: Wed Jul 20, 2016 3:59 pm
Hello XI support
we've used sendKeys command in IDE to trigger "ENTER" button, which worked fine for HTML script.
However once exported and cleaned, WWW::Selenium is unable to run this command:
UNKNOWN: ok 1 - set_timeout, 120000
ok 2 - open, /share/page/
ok 3 - type, id=page_x002e_components_x002e_slingshot-login_x0023_default-username, nagximon
ok 4 - type, id=page_x002e_components_x002e_slingshot-login_x0023_default-password, C0mplexNagMon123
ok 5 - click, id=page_x002e_components_x002e_slingshot-login_x0023_default-submit-button
ok 6 - wait_for_page_to_load, 120000
ok 7 - type, css=input.alf-search-box-text, 53202206
Can't locate object method "send_keys" via package "Test::WWW::Selenium" (also tried "WWW::Selenium") at /usr/local/share/perl5/Test/WWW/Selenium.pm line 100
1..7
# Looks like your test exited with 255 just after 7.
we've used sendKeys command in IDE to trigger "ENTER" button, which worked fine for HTML script.
However once exported and cleaned, WWW::Selenium is unable to run this command:
UNKNOWN: ok 1 - set_timeout, 120000
ok 2 - open, /share/page/
ok 3 - type, id=page_x002e_components_x002e_slingshot-login_x0023_default-username, nagximon
ok 4 - type, id=page_x002e_components_x002e_slingshot-login_x0023_default-password, C0mplexNagMon123
ok 5 - click, id=page_x002e_components_x002e_slingshot-login_x0023_default-submit-button
ok 6 - wait_for_page_to_load, 120000
ok 7 - type, css=input.alf-search-box-text, 53202206
Can't locate object method "send_keys" via package "Test::WWW::Selenium" (also tried "WWW::Selenium") at /usr/local/share/perl5/Test/WWW/Selenium.pm line 100
1..7
# Looks like your test exited with 255 just after 7.
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 => "10.x.x.114",.
port => 4444,.
browser => "*firefox",.
browser_url => "http://alfresco.konecranes.com/" );
$time->startTime("ALL");
$sel->set_timeout_ok("120000");
if ( ! $sel->open_ok("/share/page/") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->set_speed("1500") ) { }
elsif ( ! $sel->type_ok("id=page_x002e_components_x002e_slingshot-login_x0023_default-username", "nagximon") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->type_ok("id=page_x002e_components_x002e_slingshot-login_x0023_default-password", "mypassword") ) {print "Location: " . $sel->get_location() . "\n";
elsif ( ! $sel->click_ok("id=page_x002e_components_x002e_slingshot-login_x0023_default-submit-button") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}.
elsif ( ! $sel->type_ok("css=input.alf-search-box-text", "53202206") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->send_keys_ok("css=input.alf-search-box-text", "\${KEY_ENTER}") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}.
elsif ( ! $sel->click_ok("//div[\@id='search-result-table']/div/table/tbody/tr[4]/td[5]/a[2]/span") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}.
elsif ( ! $sel->click_ok("id=HEADER_USER_MENU_POPUP_text") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("id=HEADER_USER_MENU_LOGOUT_text") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}.
elsif ( !$time->endTime("ALL") ) { }
else { $time->getTimes(); }
$sel->stop();