Bug 26986: Prevent Selenium's StaleElementReferenceException
This is a follow-up bug for bug 26162 By finding the element before the click I hope to get the good element, even if the page changed in the meanwhile. Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> (cherry picked from commit836d9a3872) Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> (cherry picked from commitb0af61fdc7) Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
parent
0fdac36bbe
commit
b092a77025
|
|
@ -212,7 +212,7 @@ sub click_when_visible {
|
|||
my $clicked;
|
||||
$self->remove_error_handler;
|
||||
while ( not $clicked ) {
|
||||
eval { $elt->click };
|
||||
eval { $self->driver->find_element($xpath_selector)->click };
|
||||
$clicked = !$@;
|
||||
$self->driver->pause(1000) unless $clicked;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue