Bugzilla – Attachment 120274 Details for
Bug 28249
Selenium->wait_for_element_visible can fall in an infinite loop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28249: Prevent Selenium->wait_for_element_visible to fall in an infinite loop
Bug-28249-Prevent-Selenium-waitforelementvisible-t.patch (text/plain), 1.04 KB, created by
Jonathan Druart
on 2021-04-28 14:39:04 UTC
(
hide
)
Description:
Bug 28249: Prevent Selenium->wait_for_element_visible to fall in an infinite loop
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-28 14:39:04 UTC
Size:
1.04 KB
patch
obsolete
>From 9c4bf099e1111056a285ab2595d7dfd7bf42b7bd Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 28 Apr 2021 14:52:20 +0200 >Subject: [PATCH] Bug 28249: Prevent Selenium->wait_for_element_visible to fall > in an infinite loop > >Stop if max_retries is reached >--- > t/lib/Selenium.pm | 5 +++++ > 1 file changed, 5 insertions(+) > >diff --git a/t/lib/Selenium.pm b/t/lib/Selenium.pm >index c97aaf27a5d..242c623a901 100644 >--- a/t/lib/Selenium.pm >+++ b/t/lib/Selenium.pm >@@ -186,10 +186,15 @@ sub wait_for_element_visible { > > my ($visible, $elt); > $self->remove_error_handler; >+ my $max_retries = $self->max_retries; >+ my $i; > while ( not $visible ) { > $elt = eval {$self->driver->find_element($xpath_selector) }; > $visible = $elt && $elt->is_displayed; > $self->driver->pause(1000) unless $visible; >+ >+ die "Cannot wait more for element '$xpath_selector' to be visible" >+ if $max_retries <= ++$i > } > $self->add_error_handler; > return $elt; >-- >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 28249
: 120274