Login procedure completed

This commit is contained in:
Dirk Jahnke 2019-07-25 19:51:00 +02:00
parent daf5831c4b
commit 07e7c4fd32
1 changed files with 8 additions and 8 deletions

View File

@ -81,15 +81,15 @@ public class BasicTest {
String expectedTitle = "FreDL"; String expectedTitle = "FreDL";
wait.until(ExpectedConditions.titleIs(expectedTitle)); wait.until(ExpectedConditions.titleIs(expectedTitle));
body = driver.getPageSource(); //body = driver.getPageSource();
System.out.println("HTML: " + body); //System.out.println("HTML: " + body);
//driver.switchTo().frame("oben"); //driver.switchTo().frame("oben");
String frameObenName = "oben"; String frameObenName = "oben";
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(frameObenName)); wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(frameObenName));
body = driver.getPageSource(); //body = driver.getPageSource();
System.out.println("HTML: " + body); //System.out.println("HTML: " + body);
String versionInfo = driver.findElement(By.xpath("//table[1]/tbody/tr/td[1]/b")).getText(); String versionInfo = driver.findElement(By.xpath("//table[1]/tbody/tr/td[1]/b")).getText();
String userInfo = driver.findElement(By.xpath("//table[1]/tbody/tr/td[3]")).getText(); String userInfo = driver.findElement(By.xpath("//table[1]/tbody/tr/td[3]")).getText();
@ -99,14 +99,14 @@ public class BasicTest {
Assert.assertEquals(userInfo, expectedUserInfo); Assert.assertEquals(userInfo, expectedUserInfo);
driver.switchTo().parentFrame(); driver.switchTo().parentFrame();
//driver.switchTo().frame(1); // nested frameset
String frameRechtsName = "rechts"; String frameRechtsName = "rechts";
driver.switchTo().frame(frameRechtsName); driver.switchTo().frame(frameRechtsName);
body = driver.getPageSource(); //body = driver.getPageSource();
System.out.println("HTML: " + body); //System.out.println("HTML: " + body);
String welcomeMessage = driver.findElement(By.xpath("//body/h1")).getText(); String welcomeMessage = driver.findElement(By.xpath("//body/h1")).getText();
String expectedWelcomeMessage = "Willkommen bei FreDL";
System.out.println("Welcome message is: " + welcomeMessage); System.out.println("Welcome message is: " + welcomeMessage);
Assert.assertEquals(welcomeMessage, "Willkommen bei FreDL"); Assert.assertEquals(welcomeMessage, expectedWelcomeMessage);
} }
} }