Fixed testcase failed open authentication scheme

This commit is contained in:
Nanne Baars 2016-09-17 21:37:11 +02:00
parent 7ee7e9e683
commit 131413e11b

View File

@ -14,6 +14,7 @@ import org.junit.runner.RunWith;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
@ -330,7 +331,12 @@ public class WebGoatIT implements SauceOnDemandSessionIdProvider {
FluentWait<WebDriver> wait = new WebDriverWait(driver, 15); // wait for a maximum of 15 seconds
wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("lesson-title"), "Fail Open Authentication Scheme"));
WebElement user = driver.findElement(By.name("Username"));
wait = new FluentWait(driver)
.withTimeout(10, SECONDS)
.pollingEvery(2, SECONDS)
.ignoring(NoSuchElementException.class)
.ignoring(StaleElementReferenceException.class);
WebElement user = wait.until(ExpectedConditions.elementToBeClickable(By.name("Username")));
user.click();
user.sendKeys("Larry");