mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-06 06:49:53 -06:00
Manage exceptions in waitForPageToLoad for chrome error in version 132
Closes #36781
Closes #36782
Closes #36902
Signed-off-by: rmartinc <rmartinc@redhat.com>
(cherry picked from commit efbeb8caa6)
This commit is contained in:
@@ -135,13 +135,17 @@ public final class WaitUtils {
|
||||
|
||||
// Ensure the URL is "stable", i.e. is not changing anymore; if it'd changing, some redirects are probably still in progress
|
||||
for (int maxRedirects = 4; maxRedirects > 0; maxRedirects--) {
|
||||
currentUrl = driver.getCurrentUrl();
|
||||
FluentWait<WebDriver> wait = new FluentWait<>(driver).withTimeout(Duration.ofMillis(250));
|
||||
try {
|
||||
currentUrl = driver.getCurrentUrl();
|
||||
FluentWait<WebDriver> wait = new FluentWait<>(driver).withTimeout(Duration.ofMillis(250));
|
||||
wait.until(not(urlToBe(currentUrl)));
|
||||
}
|
||||
catch (TimeoutException e) {
|
||||
break; // URL has not changed recently - ok, the URL is stable and page is current
|
||||
} catch (TimeoutException e) {
|
||||
if (driver.getPageSource() != null) {
|
||||
break; // URL has not changed recently - ok, the URL is stable and page is current
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warnf("Unknown exception thrown waiting stabilization of the URL: %s", e.getMessage());
|
||||
pause(250);
|
||||
}
|
||||
if (maxRedirects == 1) {
|
||||
log.warn("URL seems unstable! (Some redirect are probably still in progress)");
|
||||
|
||||
Reference in New Issue
Block a user