public void WithTitle(string title) { var webDriver = _targetLocator.DefaultContent(); foreach (var windowHandle in webDriver.WindowHandles) { webDriver.SwitchTo().Window(windowHandle); if (webDriver.Title == title) { return; } } throw new ArgumentException($"Cannot find window named: {title}"); }
public IWebDriver DefaultContent() { logger_.Log(TraceLevel.Debug, Stage.General, StageType.Called); driver_.GetFrameChain().Clear(); targetLocator_.DefaultContent(); return(driver_); }
public IWebDriver DefaultContent() { logger_.Verbose("Switching to default content."); driver_.GetFrameChain().Clear(); targetLocator_.DefaultContent(); return(driver_); }
public IWebDriver FramesDoScroll(FrameChain frameChain) { logger_.Verbose("EyesTargetLocator.framesDoScroll(frameChain)"); ITargetLocator targetLocator = driver_.SwitchTo(); targetLocator.DefaultContent(); IPositionProvider scrollProvider = new ScrollPositionProvider(logger_, jsExecutor_, driver_.Eyes.GetCurrentFrameScrollRootElement()); defaultContentPositionMemento_ = scrollProvider.GetState(); foreach (Frame frame in frameChain) { logger_.Verbose("Scrolling by parent scroll position..."); Point frameLocation = frame.Location; scrollProvider.SetPosition(frameLocation); logger_.Verbose("Done! Switching to frame..."); targetLocator.Frame(frame.Reference); Frame newFrame = driver_.GetFrameChain().Peek(); newFrame.ScrollRootElement = frame.ScrollRootElement; newFrame.ScrollRootElementInnerBounds = frame.ScrollRootElementInnerBounds; logger_.Verbose("Done!"); } logger_.Verbose("Done switching into nested frames!"); return(driver_); }
public static void ParentFrame(Logger logger, ITargetLocator targetLocator, FrameChain frameChainToParent) { logger.Log(TraceLevel.Debug, Stage.General, StageType.Called); try { targetLocator.ParentFrame(); } catch { targetLocator.DefaultContent(); foreach (Frame frame in frameChainToParent) { targetLocator.Frame(frame.Reference); } } }
public static void ParentFrame(Logger logger, ITargetLocator targetLocator, FrameChain frameChainToParent) { logger.Debug("enter (static)"); try { targetLocator.ParentFrame(); } catch { targetLocator.DefaultContent(); foreach (Frame frame in frameChainToParent) { targetLocator.Frame(frame.Reference); } } }
public IWebDriver FramesDoScroll(FrameChain frameChain) { logger_.Log(TraceLevel.Debug, Stage.General, StageType.Called); ITargetLocator targetLocator = driver_.SwitchTo(); targetLocator.DefaultContent(); IPositionProvider scrollProvider = new ScrollPositionProvider(logger_, jsExecutor_, driver_.Eyes.GetCurrentFrameScrollRootElement()); defaultContentPositionMemento_ = scrollProvider.GetState(); foreach (Frame frame in frameChain) { Point frameLocation = frame.Location; scrollProvider.SetPosition(frameLocation); targetLocator.Frame(frame.Reference); Frame newFrame = driver_.GetFrameChain().Peek(); newFrame.ScrollRootElement = frame.ScrollRootElement; newFrame.ScrollRootElementInnerBounds = frame.ScrollRootElementInnerBounds; } return(driver_); }
public WebDriverInstance DefaultContent() { return(new WebDriverInstance(this.Engine.Object.InstancePrototype, m_targetLocator.DefaultContent())); }
public IWebDriver DefaultContent() { lock (m_lock) { return(new WebDriver(locator.DefaultContent(), m_lock)); } }
public IWebDriver DefaultContent() { return(_targetLocator.DefaultContent()); }