private void popFrame(WebDriver driver, Locator ploc, List<Locator> selectedFrameLocators) { ploc.frameIndexList.pollLast(); if (noParentFrameWebDriver != driver) { try { driver.switchTo().parentFrame(); return; } catch (RuntimeException e) { if (!isParentFrameUnsupported(e)) throw e; log.warn("{} does not support \"parentFrame\".", driver.getClass().getSimpleName()); noParentFrameWebDriver = driver; } } switchToFrame(driver, selectedFrameLocators); for (int index : ploc.frameIndexList) driver.switchTo().frame(index); }
@Override public Boolean apply(WebDriver driver) { if (!switchedToFrame) { try { waitAndSwitchToFrame(By.id("ide-application-iframe")); switchedToFrame = true; } catch (NoSuchElementException | TimeoutException e) { driver.switchTo().parentFrame(); return false; } } return isVisible(By.id("gwt-debug-projectTree")); } });
/** * Switch to parent of current IFrame. */ public static void switchToParent() { getLogger().info("switching to parent IFrame."); switchTo().parentFrame(); }
this.driver.switchTo().parentFrame(); switchedToFrameCount--;
mDriver.switchTo().parentFrame(); return; mDriver.switchTo().parentFrame();
driver.switchTo().parentFrame(); fc.pop(); frame = fc.peek();
/** * Verify a widget presence, based of its index position among other widgets of its type. The * method assumes there may be more than one widgets of certain type on the article. */ protected boolean isWidgetVisible(int widgetIndex) { boolean result; List<WebElement> widgetIFrameList = getWidgetIFrameList(); if (widgetIFrameList.isEmpty()) { result = false; } else { WebElement widgetIFrame = widgetIFrameList.get(widgetIndex); wait.forElementVisible(widgetIFrame); driver.switchTo().frame(widgetIFrame); wait.forElementVisible(getWidgetBody()); driver.switchTo().parentFrame(); result = true; } logVisibility(result); return result; } }
@Override public String invoke(ZestRuntime runtime) throws ZestClientFailException { WebDriver wd = runtime.getWebDriver(this.getWindowHandle()); if (wd == null) { throw new ZestClientFailException( this, "No client: " + runtime.getVariable(getWindowHandle())); } if (this.frameIndex >= 0) { wd.switchTo().frame(this.frameIndex); } else if (this.isParent()) { wd.switchTo().parentFrame(); } else { wd.switchTo().frame(this.frameName); } return this.windowHandle; } }
/** * Provides a {@link WebDriver} with access to the iframe's content. */ public <T> T withinIFrame(Function<WebDriver, T> iFrameConsumer) { setIFrameAndSrc(); try { WebDriver frameDriver = driver.switchTo().frame(iframe.getAttribute("id")); return iFrameConsumer.apply(frameDriver); } finally { try { driver.switchTo().parentFrame(); } catch (AbstractMethodError|NoSuchMethodError|WebDriverException e) { log.warn("Webdriver wasn't able to switch back to the parent frame, so we're switching to the default content frame instead."); driver.switchTo().defaultContent(); } } }
public static Performable toParentFrame() { return new DriverTask( driver -> driver.switchTo().parentFrame() ); }
public WebDriver parentFrame() { return targetLocator.parentFrame(); }
/** * See parent. */ @Override public WebDriver parentFrame() { return targetLocator.parentFrame(); }
@Given("^" + THAT + THE_USER + " switch(?:es)? to the parent frame$") public void that_we_switch_to_the_parent_frame() { if (driver instanceof PhantomJSDriver) { throw new IllegalStateException("PhantomJSDriver doesn't support the parent frame location, see https://github.com/SeleniumHQ/selenium/issues/1737"); } driver.switchTo().parentFrame(); }
@Override public void switchToParentFrame() { driver.switchTo().parentFrame(); }
public boolean isTinymceV4() { driver.switchTo().parentFrame(); return (Integer.valueOf((String) executor.executeScript("return tinymce.majorVersion")) == 4); }
@Override public WebDriver parentFrame() { ensureWebDriver(); delegate.switchTo().parentFrame(); return delegate; }
/** * See parent. */ @Override public WebDriver parentFrame() { return targetLocator.parentFrame(); }
public static void parentFrame(Logger logger, WebDriver.TargetLocator targetLocator, FrameChain frameChainToParent) { logger.verbose("enter (static)"); try { targetLocator.parentFrame(); } catch (Exception WebDriverException) { targetLocator.defaultContent(); for (Frame frame : frameChainToParent) { targetLocator.frame(frame.getReference()); } } }
@Override public void switchToParentFrame() { driver.switchTo().parentFrame(); }
@Override public WebDriver parentFrame() { return delegate.parentFrame(); }