From d0079e81a5f6a5e94af8a53d3ad3748073176dc4 Mon Sep 17 00:00:00 2001 From: Dirk Jahnke Date: Thu, 25 Jul 2019 16:39:03 +0200 Subject: [PATCH] Debugging login --- src/test/java/BasicTest.java | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/test/java/BasicTest.java b/src/test/java/BasicTest.java index 3f4d9ea..9f67478 100644 --- a/src/test/java/BasicTest.java +++ b/src/test/java/BasicTest.java @@ -71,31 +71,28 @@ public class BasicTest { WebElement loginButton = wait.until(ExpectedConditions.elementToBeClickable(By.name("doLogin"))); // WebElement loginButton = wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.name("doLogin")))); - String scaleInfo = driver.findElement(By.xpath("//table/tbody/tr/td/div")).getText(); - //String scaleInfo = driver.findElement(By.xpath("/table[@class='loginall']/tbody/tr/td/div")).getText(); + //String scaleInfo = driver.findElement(By.xpath("//table/tbody/tr/td/div")).getText(); + String scaleInfo = driver.findElement(By.xpath("//table[@class='loginall']/tbody/tr/td/div")).getText(); System.out.println("Scale: " + scaleInfo); - driver.findElement(By.name("login")).sendKeys("system"); - driver.findElement(By.name("password")).sendKeys("system"); + driver.findElement(By.xpath("//input[@name='login']")).sendKeys("system"); + driver.findElement(By.xpath("//input[@name='password']")).sendKeys("system"); loginButton.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(); - //wait.until(ExpectedConditions.ElementIsVisible(By.xpath("//input[@class='menu'][0]")); - //wait.until(ExpectedConditions.ElementIsVisible(By.className("menu"))); String expectedTitle = "FreDL"; wait.until(ExpectedConditions.titleIs(expectedTitle)); + //driver.switchTo().frame("oben"); String frameObenName = "oben"; wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(frameObenName)); - String versionInfo = driver.findElement(By.xpath("/table/tr/td/b")).getText(); - String userInfo = driver.findElement(By.xpath("/table/tr/td[3]")).getText(); + String versionInfo = driver.findElement(By.xpath("//table/tr/td/b")).getText(); + String userInfo = driver.findElement(By.xpath("//table/tr/td[2]")).getText(); System.out.println("Version info found: " + versionInfo); System.out.println("User info found: " + userInfo); + driver.switchTo().frame("rechts"); - String welcomeMessage = driver.findElement(By.xpath("/h1")).getText(); + String welcomeMessage = driver.findElement(By.xpath("//body/h1")).getText(); System.out.println("Welcome message is: " + welcomeMessage); Assert.assertEquals(welcomeMessage, "Willkommen bei FreDL"); }