From 9abc5324ff9953707abd279657d126a9fca5e4b9 Mon Sep 17 00:00:00 2001 From: Dirk Jahnke Date: Thu, 25 Jul 2019 12:18:39 +0200 Subject: [PATCH] Retry using name but added wait after submit/click --- src/test/java/BasicTest.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/test/java/BasicTest.java b/src/test/java/BasicTest.java index 025261b..f51e1c0 100644 --- a/src/test/java/BasicTest.java +++ b/src/test/java/BasicTest.java @@ -31,9 +31,15 @@ public class BasicTest { @Test public void verifyLoginAsSystemUser() { driver.navigate().to(URL); - driver.findElement(By.xpath("//input[@name='login']")).sendKeys("system"); - driver.findElement(By.xpath("//input[@name='password']")).sendKeys("system"); - driver.findElement(By.xpath("//input[@name='doLogin']")).submit(); + driver.findElement(By.name("login")).sendKeys("system"); + driver.findElement(By.name("password")).sendKeys("system"); + driver.findElement(By.name("doLogin")).click(); + //driver.findElement(By.xpath("//input[@name='login']")).sendKeys("system"); + //driver.findElement(By.xpath("//input[@name='password']")).sendKeys("system"); + //driver.findElement(By.xpath("//input[@name='doLogin']")).submit(); + WebDriverWait waitForLoginDone = new WebDriverWait(browser, 15); + //waitForLoginDone.until(ExpectedConditions.ElementIsVisible(By.xpath("//input[@class='menu'][0]")); + waitForLoginDone.until(ExpectedConditions.ElementIsVisible(By.classname("menu")); driver.switchTo().frame("oben"); String versionInfo = driver.findElement(By.xpath("/table/tr/td/b")).getText(); String userInfo = driver.findElement(By.xpath("/table/tr/td[3]")).getText();