[java] Fixing a test, more information here:
@@ -770,6 +770,7 @@ public void testShouldNotBeAbleToLocateASingleElementOnABlankPage() {
@SwitchToTopAfterTest
@Test
+ @Ignore(FIREFOX)
public void testAnElementFoundInADifferentFrameIsStale() {
driver.get(pages.missedJsReferencePage);
driver.switchTo().frame("inner");
@@ -779,6 +780,21 @@ public void testAnElementFoundInADifferentFrameIsStale() {
.isThrownBy(element::getText);
}
+ @SwitchToTopAfterTest
+ @Test
+ @Ignore(CHROME)
+ @Ignore(EDGE)
+ @Ignore(IE)
+ @Ignore(SAFARI)
+ public void testAnElementInAFrameCannotBeAccessedFromAnotherFrame() {
+ driver.get(pages.missedJsReferencePage);
+ driver.switchTo().frame("inner");
+ WebElement element = driver.findElement(By.id("oneline"));
+ driver.switchTo().defaultContent();
+ assertThatExceptionOfType(NoSuchElementException.class)
+ .isThrownBy(element::getText);
+ }
+
@SwitchToTopAfterTest
@Test
@NotYetImplemented(SAFARI)
