From 6919b15013fd831270fcb4c53c28985d73d4e9c5 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 17 Sep 2016 22:37:20 +0200 Subject: [PATCH] Fix failing testcases --- .../java/org/owasp/webgoat/plugins/WebGoatIT.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/webgoat-container/src/test/java/org/owasp/webgoat/plugins/WebGoatIT.java b/webgoat-container/src/test/java/org/owasp/webgoat/plugins/WebGoatIT.java index af8d016bf..69b20a0dd 100644 --- a/webgoat-container/src/test/java/org/owasp/webgoat/plugins/WebGoatIT.java +++ b/webgoat-container/src/test/java/org/owasp/webgoat/plugins/WebGoatIT.java @@ -142,6 +142,7 @@ public class WebGoatIT implements SauceOnDemandSessionIdProvider { // Linux, Firefox 37 browsers.add(new String[]{"Linux", "37", "firefox", null, null}); + // windows 7, IE 9 //browsers.add(new String[]{"Windows 7", "9", "internet explorer", null, null}); @@ -295,7 +296,12 @@ public class WebGoatIT implements SauceOnDemandSessionIdProvider { FluentWait wait = new WebDriverWait(driver, 15); // wait for a maximum of 15 seconds wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("lesson-title"), "Using an Access Control Matrix")); - WebElement user = driver.findElement(By.name("User")); + wait = new FluentWait(driver) + .withTimeout(10, SECONDS) + .pollingEvery(2, SECONDS) + .ignoring(NoSuchElementException.class) + .ignoring(StaleElementReferenceException.class); + WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.name("User"))); user.click(); user.sendKeys("Larry"); @@ -334,7 +340,7 @@ public class WebGoatIT implements SauceOnDemandSessionIdProvider { .pollingEvery(2, SECONDS) .ignoring(NoSuchElementException.class) .ignoring(StaleElementReferenceException.class); - WebElement user = wait.until(ExpectedConditions.elementToBeClickable(By.name("Username"))); + WebElement user = wait.until(ExpectedConditions.presenceOfElementLocated(By.name("Username"))); user.click(); user.sendKeys("Larry"); @@ -397,6 +403,10 @@ public class WebGoatIT implements SauceOnDemandSessionIdProvider { WebElement submit = driver.findElement(By.name("SUBMIT")); submit.click(); + wait = new FluentWait(driver) + .withTimeout(10, SECONDS) + .pollingEvery(2, SECONDS) + .ignoring(NoSuchElementException.class); wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("message"), "Stage 1 completed.")); //Stage 2