Using switchTo.defaultContent to get root in framed content.
This commit is contained in:
parent
5c5d50ec13
commit
d4ad20e813
|
@ -64,6 +64,7 @@ public class BasicTest {
|
||||||
|
|
||||||
// FredlTestHelper.printPageSource(driver);
|
// FredlTestHelper.printPageSource(driver);
|
||||||
|
|
||||||
|
driver.switchTo().defaultContent();
|
||||||
String frameObenName = "oben";
|
String frameObenName = "oben";
|
||||||
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(frameObenName));
|
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(frameObenName));
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ public class BasicTest {
|
||||||
System.out.println("User info found: " + userInfo);
|
System.out.println("User info found: " + userInfo);
|
||||||
Assert.assertEquals(userInfo, expectedUserInfo);
|
Assert.assertEquals(userInfo, expectedUserInfo);
|
||||||
|
|
||||||
driver.switchTo().parentFrame();
|
driver.switchTo().defaultContent();
|
||||||
String frameRechtsName = "rechts";
|
String frameRechtsName = "rechts";
|
||||||
driver.switchTo().frame(frameRechtsName);
|
driver.switchTo().frame(frameRechtsName);
|
||||||
|
|
||||||
|
@ -88,11 +89,12 @@ public class BasicTest {
|
||||||
Assert.assertEquals(welcomeMessage, expectedWelcomeMessage);
|
Assert.assertEquals(welcomeMessage, expectedWelcomeMessage);
|
||||||
|
|
||||||
// we leave our tests always with having the driver located to the top frame
|
// we leave our tests always with having the driver located to the top frame
|
||||||
driver.switchTo().parentFrame();
|
driver.switchTo().defaultContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void verifyExistenceOfMainMenuButtons() {
|
public void verifyExistenceOfMainMenuButtons() {
|
||||||
|
driver.switchTo().defaultContent();
|
||||||
driver.switchTo().frame("oben");
|
driver.switchTo().frame("oben");
|
||||||
// Verify existence of menu buttons
|
// Verify existence of menu buttons
|
||||||
Assert.assertEquals(FredlTestHelper.elementExistsById("admin-menu-button"), true);
|
Assert.assertEquals(FredlTestHelper.elementExistsById("admin-menu-button"), true);
|
||||||
|
@ -106,7 +108,8 @@ public class BasicTest {
|
||||||
Assert.assertEquals(FredlTestHelper.elementExistsById("calendar-menu-button"), true);
|
Assert.assertEquals(FredlTestHelper.elementExistsById("calendar-menu-button"), true);
|
||||||
Assert.assertEquals(FredlTestHelper.elementExistsById("idman-menu-button"), true);
|
Assert.assertEquals(FredlTestHelper.elementExistsById("idman-menu-button"), true);
|
||||||
Assert.assertEquals(FredlTestHelper.elementExistsById("lola-menu-button"), true);
|
Assert.assertEquals(FredlTestHelper.elementExistsById("lola-menu-button"), true);
|
||||||
Assert.assertEquals(FredlTestHelper.elementExistsById("logout-menu-button"), true); driver.switchTo().parentFrame();
|
Assert.assertEquals(FredlTestHelper.elementExistsById("logout-menu-button"), true);
|
||||||
|
driver.switchTo().defaultContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue