You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a project there is an error handler [1] added to take a screenshot on test failure.
At some point in a test, there is a find_element that fails and the handler is called. And then taking a screenshots fails. (so the handler is called over and over but the lack of try catch (wait, that might not even help) to prevent that is not the current issue)
Is there a way to know more about from where the error comes from?
I even tried to mess with that place
and replace the call to the error handler (that will result in an endless recursion) with just a croak $_; but I 'm not sure that's the right variable where there is a chance to find the error that was returned by the rest of Selenium::Remote::Driver or selenium or the browser.
Selenium::Remote::Driver: 1.47
Selenium: 3.141.59
Firefox: 92 (last version compatible with selenium 3 it seems)
Output of the error: [2]
[1]
sub add_error_handler {
my ( $self ) = @_;
$self->{driver}->error_handler(
sub {
my ( $driver, $selenium_error ) = @_;
print STDERR "\nSTRACE:";
my $i = 1;
while ( (my @call_details = (caller($i++))) ){
print STDERR "\t" . $call_details[1]. ":" . $call_details[2] . " in " . $call_details[3]."\n";
}
print STDERR "\n";
$self->capture( $driver ); #
$driver->quit();
croak $selenium_error;
}
);
}
sub capture {
my ( $class, $driver ) = @_;
$driver->capture_screenshot('selenium_failure.png');
}
[2]
STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in (eval)
/usr/share/perl5/Selenium/Remote/Finders.pm:21 in Selenium::Remote::Driver::find_element
/usr/share/perl5/Try/Tiny.pm:102 in Selenium::Remote::Finders::try {...}
/usr/share/perl5/Try/Tiny.pm:93 in (eval)
/usr/share/perl5/Selenium/Remote/Finders.pm:26 in Try::Tiny::try
t/db_dependent/selenium/regressions.t:200 in Selenium::Remote::Finders::__ANON__
/usr/share/perl/5.34/Test/Builder.pm:374 in main::__ANON__
/usr/share/perl/5.34/Test/Builder.pm:374 in (eval)
/usr/share/perl/5.34/Test/More.pm:809 in Test::Builder::subtest
t/db_dependent/selenium/regressions.t:222 in Test::More::subtest
Error while executing command: no such element: Unable to locate element: #issues-table [id*="title_"] at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.
at /usr/share/perl5/Selenium/Remote/Driver.pm line 356.
at /usr/share/perl5/Selenium/Remote/Finders.pm line 26.
STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1371 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1371 in (eval)
t/db_dependent/selenium/regressions.t:203 in Selenium::Remote::Driver::find_elements
/usr/share/perl/5.34/Test/Builder.pm:374 in main::__ANON__
/usr/share/perl/5.34/Test/Builder.pm:374 in (eval)
/usr/share/perl/5.34/Test/More.pm:809 in Test::Builder::subtest
t/db_dependent/selenium/regressions.t:222 in Test::More::subtest
STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1119 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1129 in Selenium::Remote::Driver::screenshot
/kohadevbox/koha/t/lib/Selenium.pm:30 in Selenium::Remote::Driver::capture_screenshot
/kohadevbox/koha/t/lib/Selenium.pm:65 in t::lib::Selenium::capture
/usr/share/perl5/Selenium/Remote/Driver.pm:356 in t::lib::Selenium::__ANON__
/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1371 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1371 in (eval)
t/db_dependent/selenium/regressions.t:203 in Selenium::Remote::Driver::find_elements
/usr/share/perl/5.34/Test/Builder.pm:374 in main::__ANON__
/usr/share/perl/5.34/Test/Builder.pm:374 in (eval)
/usr/share/perl/5.34/Test/More.pm:809 in Test::Builder::subtest
t/db_dependent/selenium/regressions.t:222 in Test::More::subtest
STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1119 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1129 in Selenium::Remote::Driver::screenshot
/kohadevbox/koha/t/lib/Selenium.pm:30 in Selenium::Remote::Driver::capture_screenshot
/kohadevbox/koha/t/lib/Selenium.pm:65 in t::lib::Selenium::capture
/usr/share/perl5/Selenium/Remote/Driver.pm:356 in t::lib::Selenium::__ANON__
/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1119 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1129 in Selenium::Remote::Driver::screenshot
/kohadevbox/koha/t/lib/Selenium.pm:30 in Selenium::Remote::Driver::capture_screenshot
/kohadevbox/koha/t/lib/Selenium.pm:65 in t::lib::Selenium::capture
/usr/share/perl5/Selenium/Remote/Driver.pm:356 in t::lib::Selenium::__ANON__
/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1371 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1371 in (eval)
t/db_dependent/selenium/regressions.t:203 in Selenium::Remote::Driver::find_elements
/usr/share/perl/5.34/Test/Builder.pm:374 in main::__ANON__
/usr/share/perl/5.34/Test/Builder.pm:374 in (eval)
/usr/share/perl/5.34/Test/More.pm:809 in Test::Builder::subtest
t/db_dependent/selenium/regressions.t:222 in Test::More::subtest
STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1119 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1129 in Selenium::Remote::Driver::screenshot
/kohadevbox/koha/t/lib/Selenium.pm:30 in Selenium::Remote::Driver::capture_screenshot
/kohadevbox/koha/t/lib/Selenium.pm:65 in t::lib::Selenium::capture
/usr/share/perl5/Selenium/Remote/Driver.pm:356 in t::lib::Selenium::__ANON__
/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1119 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1129 in Selenium::Remote::Driver::screenshot
/kohadevbox/koha/t/lib/Selenium.pm:30 in Selenium::Remote::Driver::capture_screenshot
/kohadevbox/koha/t/lib/Selenium.pm:65 in t::lib::Selenium::capture
/usr/share/perl5/Selenium/Remote/Driver.pm:356 in t::lib::Selenium::__ANON__
/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1119 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1129 in Selenium::Remote::Driver::screenshot
/kohadevbox/koha/t/lib/Selenium.pm:30 in Selenium::Remote::Driver::capture_screenshot
/kohadevbox/koha/t/lib/Selenium.pm:65 in t::lib::Selenium::capture
/usr/share/perl5/Selenium/Remote/Driver.pm:356 in t::lib::Selenium::__ANON__
/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...}
/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
(eval 583):1 in Selenium::Remote::Driver::__ANON__
(eval 585):2 in Selenium::Remote::Driver::__ANON__
/usr/share/perl5/Selenium/Remote/Driver.pm:1371 in Selenium::Remote::Driver::_execute_command
/usr/share/perl5/Selenium/Remote/Driver.pm:1371 in (eval)
t/db_dependent/selenium/regressions.t:203 in Selenium::Remote::Driver::find_elements
/usr/share/perl/5.34/Test/Builder.pm:374 in main::__ANON__
/usr/share/perl/5.34/Test/Builder.pm:374 in (eval)
/usr/share/perl/5.34/Test/More.pm:809 in Test::Builder::subtest
t/db_dependent/selenium/regressions.t:222 in Test::More::subtest
[...]
The text was updated successfully, but these errors were encountered:
The error handler has no inherent protections against the handler itself exploding.
Perhaps I should build some in? Wrapping it with an eval { ... } or do { ... } block should do the trick.
Maybe adding that might also help getting output of the error that made the handler explode :)
I hope at least. For that screenshot thing, it's very weird, that only happens on my PC that runs the same containers as the CI. For which I haven't heard about builds getting stuck until timeout and filling the storage with millions of lines of stacktraces ^^" (really, that super fast, a few minutes is already hundreds of MB)
In a project there is an error handler [1] added to take a screenshot on test failure.
At some point in a test, there is a find_element that fails and the handler is called. And then taking a screenshots fails. (so the handler is called over and over but the lack of try catch (wait, that might not even help) to prevent that is not the current issue)
Is there a way to know more about from where the error comes from?
I even tried to mess with that place
Selenium-Remote-Driver/lib/Selenium/Remote/Driver.pm
Line 848 in 1f078d8
croak $_;
but I 'm not sure that's the right variable where there is a chance to find the error that was returned by the rest of Selenium::Remote::Driver or selenium or the browser.Selenium::Remote::Driver: 1.47
Selenium: 3.141.59
Firefox: 92 (last version compatible with selenium 3 it seems)
Output of the error: [2]
[1]
[2]
The text was updated successfully, but these errors were encountered: