Bugzilla – Attachment 108568 Details for
Bug 26162
Prevent Selenium's StaleElementReferenceException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26162: Don't fall into an infinite loop
Bug-26162-Dont-fall-into-an-infinite-loop.patch (text/plain), 1.36 KB, created by
Jonathan Druart
on 2020-08-19 05:27:01 UTC
(
hide
)
Description:
Bug 26162: Don't fall into an infinite loop
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-08-19 05:27:01 UTC
Size:
1.36 KB
patch
obsolete
>From 0746cc03bdf09c7a0960886866afbc434fcac357 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 19 Aug 2020 07:19:09 +0200 >Subject: [PATCH] Bug 26162: Don't fall into an infinite loop > >If something went wrong we do want to stop the script! >--- > t/lib/Selenium.pm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > >diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm >index 7cf5ad26a6..42cda1d65f 100644 >--- a/t/lib/Selenium.pm >+++ b/t/lib/Selenium.pm >@@ -187,7 +187,8 @@ sub show_all_entries { > $self->driver->find_element( $xpath_selector > . '//div[@class="dataTables_length"]/label/select/option[@value="-1"]' > )->click; >- my ($all_displayed); >+ my ($all_displayed, $i); >+ my $max_retries = $self->max_retries; > while ( not $all_displayed ) { > my $dt_infos = $self->driver->get_text( > $xpath_selector . '//div[@class="dataTables_info"]' ); >@@ -197,6 +198,9 @@ sub show_all_entries { > } > > $self->driver->pause(1000) unless $all_displayed; >+ >+ die "Cannot show all entries from table $xpath_selector" >+ if $max_retries <= ++$i > } > } > >@@ -216,6 +220,8 @@ sub click_when_visible { > $elt->click unless $clicked; # finally Raise the error > } > >+sub max_retries { 10 } >+ > =head1 NAME > > t::lib::Selenium - Selenium helper module >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26162
:
107888
|
107889
|
107940
|
107985
| 108568 |
108569