From 966a6edb60ac187253b8801733ffc7e52fc45392 Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Thu, 2 Jan 2020 12:00:56 +0200 Subject: Be more graceful for timeouts while Selenium Issue-ID: VID-647 Change-Id: I0137af588d01b8cad7a9d26ac9789d1685ad0c02 Signed-off-by: Ittay Stern --- .../org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'vid-automation/src/main/java/org/onap') diff --git a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java index c2c93e734..dd632d201 100644 --- a/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java +++ b/vid-automation/src/main/java/org/onap/sdc/ci/tests/utilities/GeneralUIUtils.java @@ -642,13 +642,14 @@ public final class GeneralUIUtils { public static void waitForAngular2(){ WebDriverWait wait = newWait(90); wait.until(AdditionalConditions.pageLoadWait()); + waitForLoader(60); try { - WebDriverWait briefWait = newWait(2); + WebDriverWait briefWait = newWait(3); briefWait.until(AdditionalConditions.angular2HasFinishedProcessing()); } catch (TimeoutException | org.openqa.selenium.ScriptTimeoutException e) { logger.info("Ignoring TimeoutException while waiting for angular2: {}", e, e); + waitForLoader(30); } - waitForLoader(10); } public static Object getAllElementAttributes(WebElement element) { @@ -826,4 +827,14 @@ public final class GeneralUIUtils { ultimateWait(); } + public static void acceptDeadObjectException(Runnable todo) { + try { + todo.run(); + } catch (org.openqa.selenium.WebDriverException e) { + if (!e.getMessage().startsWith("TypeError: can't access dead object")) { + throw e; + } + } + } + } -- cgit