This is a follow-up bug for bug 26162 The test is still failing: STRACE: /usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...} /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:353 in Try::Tiny::try (eval 1687):1 in Selenium::Remote::Driver::__ANON__ (eval 1689):2 in Selenium::Remote::Driver::__ANON__ /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:1331 in Selenium::Remote::Driver::_execute_command /usr/local/share/perl/5.28.1/Selenium/Remote/Driver.pm:1331 in (eval) /kohadevbox/koha/t/lib/Selenium.pm:126 in Selenium::Remote::Driver::find_element t/db_dependent/selenium/administration_tasks.t:137 in t::lib::Selenium::fill_form The screenshot is showing the library list, which means the edit button has not been clicked. In the selenium logs there is: 12:44:39 selenium_1 | 03:44:38.642 WARN - Exception: Unable to locate element: {"method":"xpath","selector":"//*[@id=\"branchname\"]"} 12:44:39 selenium_1 | For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Created attachment 113337 [details] [review] 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.
Created attachment 113360 [details] [review] 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>
As for code change, it's simple and looks good.
Created attachment 113688 [details] [review] 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>
Run the tests in a loop for a while and couldn't trigger an error.. mind you, I couldn't when I did the same with the first attempt to fix either. Code seems sane, fingers crossed it resolves the issue more long term. Passing QA
Pushed to master for 20.11, thanks to everybody involved!
Pushed to 20.05.x for 20.05.07
Backported to 19.11.x branch for 19.11.13