SELENIUM errors in GUI, but works with Perl CLI
Posted: Thu Jun 23, 2016 8:50 pm
Hello XI Support
We are getting errors (file attached) when using check_selenium in XI GUI, while perl command works in CLI for the same scripts:
--------------------------------------------------------------------------------------------------------------------------------------------------------
[root@fikc-nagxidev01 tmp]# perl msportal-3
ok 1 - set_timeout, 120000
ok 2 - open, /login.srf?wa=wsignin1.0&rpsnv=4&ct=1466534348&rver=6.7.6640.0&wp=MCMBI&wreply=https%3a%2f%2fportal.office.com%2flanding.aspx%3ftarget%3d%252fdefault.aspx&lc=1033&id=501392&msafed=0&client-request-id=64b6eb2d-3b6f-4bcb-8138-08f686ad8ebd
ok 3 - type, id=cred_userid_inputtext, [email protected]
ok 4 - type, id=passwordInput, mypassword
ok 5 - click, id=submitButton
ok 6 - wait_for_page_to_load, 120000
ok 7 - click, //a[@id='ShellSites_link']/span
ok 8 - wait_for_page_to_load, 120000
ok 9 - click, xpath=(//button[@type='button'])[12]
ok 10 - click, //a[@id='O365_SubLink_ShellSignout']/div/span[2]
ok 11 - wait_for_page_to_load, 120000
Key: ALL, Value: 1466730047.48348:1
Start Time: 1466730047.48348
End Time: 1466730087.48264
OK: Processes completed after 39.999 of page loading.|0| ALL=39.999s;60;90;0;120 |1..11
[root@fikc-nagxidev01 tmp]# perl msportal-4
ok 1 - set_timeout, 120000
ok 2 - open, /login.srf?wa=wsignin1.0&rpsnv=4&ct=1466534348&rver=6.7.6640.0&wp=MCMBI&wreply=https%3a%2f%2fportal.office.com%2flanding.aspx%3ftarget%3d%252fdefault.aspx&lc=1033&id=501392&msafed=0&client-request-id=64b6eb2d-3b6f-4bcb-8138-08f686ad8ebd
ok 3 - type, id=cred_userid_inputtext, [email protected]
ok 4 - type, id=passwordInput, mypassword
ok 5 - click, id=submitButton
ok 6 - wait_for_page_to_load, 120000
ok 7 - click, //a[@id='ShellDocuments_link']/span
ok 8 - wait_for_page_to_load, 120000
ok 9 - click, xpath=(//button[@type='button'])[11]
ok 10 - click, //a[@id='O365_SubLink_ShellSignout']/div/span[2]
ok 11 - wait_for_page_to_load, 120000
Key: ALL, Value: 1466731031.36598:1
Start Time: 1466731031.36598
End Time: 1466731083.44709
OK: Processes completed after 52.081 of page loading.|0| ALL=52.081s;60;90;0;120 |1..11
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
msportal-3 script (XI ERROR: Element xpath=(//button[@type='button'])[11] not found)
msportal-4 (XI ERROR: Element xpath=(//button[@type='button'])[12] not found)
We are getting errors (file attached) when using check_selenium in XI GUI, while perl command works in CLI for the same scripts:
--------------------------------------------------------------------------------------------------------------------------------------------------------
[root@fikc-nagxidev01 tmp]# perl msportal-3
ok 1 - set_timeout, 120000
ok 2 - open, /login.srf?wa=wsignin1.0&rpsnv=4&ct=1466534348&rver=6.7.6640.0&wp=MCMBI&wreply=https%3a%2f%2fportal.office.com%2flanding.aspx%3ftarget%3d%252fdefault.aspx&lc=1033&id=501392&msafed=0&client-request-id=64b6eb2d-3b6f-4bcb-8138-08f686ad8ebd
ok 3 - type, id=cred_userid_inputtext, [email protected]
ok 4 - type, id=passwordInput, mypassword
ok 5 - click, id=submitButton
ok 6 - wait_for_page_to_load, 120000
ok 7 - click, //a[@id='ShellSites_link']/span
ok 8 - wait_for_page_to_load, 120000
ok 9 - click, xpath=(//button[@type='button'])[12]
ok 10 - click, //a[@id='O365_SubLink_ShellSignout']/div/span[2]
ok 11 - wait_for_page_to_load, 120000
Key: ALL, Value: 1466730047.48348:1
Start Time: 1466730047.48348
End Time: 1466730087.48264
OK: Processes completed after 39.999 of page loading.|0| ALL=39.999s;60;90;0;120 |1..11
[root@fikc-nagxidev01 tmp]# perl msportal-4
ok 1 - set_timeout, 120000
ok 2 - open, /login.srf?wa=wsignin1.0&rpsnv=4&ct=1466534348&rver=6.7.6640.0&wp=MCMBI&wreply=https%3a%2f%2fportal.office.com%2flanding.aspx%3ftarget%3d%252fdefault.aspx&lc=1033&id=501392&msafed=0&client-request-id=64b6eb2d-3b6f-4bcb-8138-08f686ad8ebd
ok 3 - type, id=cred_userid_inputtext, [email protected]
ok 4 - type, id=passwordInput, mypassword
ok 5 - click, id=submitButton
ok 6 - wait_for_page_to_load, 120000
ok 7 - click, //a[@id='ShellDocuments_link']/span
ok 8 - wait_for_page_to_load, 120000
ok 9 - click, xpath=(//button[@type='button'])[11]
ok 10 - click, //a[@id='O365_SubLink_ShellSignout']/div/span[2]
ok 11 - wait_for_page_to_load, 120000
Key: ALL, Value: 1466731031.36598:1
Start Time: 1466731031.36598
End Time: 1466731083.44709
OK: Processes completed after 52.081 of page loading.|0| ALL=52.081s;60;90;0;120 |1..11
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
msportal-3 script (XI ERROR: Element xpath=(//button[@type='button'])[11] not found)
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.96.36.114",.
port => 4444,.
browser => "*firefox",.
browser_url => "https://login.microsoftonline.com/" );
$time->startTime("ALL");
$sel->set_timeout_ok("120000");
if ( ! $sel->open_ok("/login.srf?wa=wsignin1.0&rpsnv=4&ct=1466534348&rver=6.7.6640.0&wp=MCMBI&wreply=https%3a%2f%2fportal.office.com%2flanding.aspx%3ftarge
elsif ( ! $sel->set_speed("1500") ) { }
elsif ( ! $sel->type_ok("id=cred_userid_inputtext", "nagximon\@mydomain.com") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->pause(8000) ) {}
elsif ( ! $sel->type_ok("id=passwordInput", "mypassword") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("id=submitButton") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}.
elsif ( ! $sel->pause(8000) ) {}
elsif ( ! $sel->click_ok("//a[\@id='ShellSites_link']/span") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}.
elsif ( ! $sel->pause(8000) ) {}
elsif ( ! $sel->click_ok("xpath=(//button[\@type='button'])[12]") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("//a[\@id='O365_SubLink_ShellSignout']/div/span[2]") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}.
elsif ( ! $time->endTime("ALL") ) { }
else { $time->getTimes(); }
$sel->stop();
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.96.36.114",
port => 4444,
browser => "*firefox",
browser_url => "https://login.microsoftonline.com/" );
$time->startTime("ALL");
$sel->set_timeout_ok("120000");
if ( ! $sel->open_ok("/login.srf?wa=wsignin1.0&rpsnv=4&ct=1466534348&rver=6.7.6640.0&wp=MCMBI&wreply=https%3a%2f%2fportal.office.com%2flanding.aspx%3ftarget%
3d%252fdefault.aspx&lc=1033&id=501392&msafed=0&client-request-id=64b6eb2d-3b6f-4bcb-8138-08f686ad8ebd") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->set_speed("1500") ) { }
elsif ( ! $sel->type_ok("id=cred_userid_inputtext", "nagximon\@mydomain.com") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->pause(8000) ) {}
elsif ( ! $sel->type_ok("id=passwordInput", "mypassword") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->click_ok("id=submitButton") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}
elsif ( ! $sel->pause(8000) ) {}
elsif ( ! $sel->click_ok("//a[\@id='ShellDocuments_link']/span") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}
elsif ( ! $sel->pause(12000) ) {}
elsif ( ! $sel->click_ok("xpath=(//button[\@type='button'])[11]") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->pause(8000) ) {}
elsif ( ! $sel->click_ok("//a[\@id='O365_SubLink_ShellSignout']/div/span[2]") ) {print "Location: " . $sel->get_location() . "\n";}
elsif ( ! $sel->wait_for_page_to_load_ok("120000") ) {}
elsif ( !$time->endTime("ALL") ) { }
else { $time->getTimes(); }
$sel->stop();