Exemplo n.º 1
0
        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}");
        }
Exemplo n.º 2
0
 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_);
        }
Exemplo n.º 5
0
 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);
         }
     }
 }
Exemplo n.º 7
0
        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_);
        }
Exemplo n.º 8
0
 public WebDriverInstance DefaultContent()
 {
     return(new WebDriverInstance(this.Engine.Object.InstancePrototype, m_targetLocator.DefaultContent()));
 }
Exemplo n.º 9
0
 public IWebDriver DefaultContent()
 {
     lock (m_lock) { return(new WebDriver(locator.DefaultContent(), m_lock)); }
 }
Exemplo n.º 10
0
 public IWebDriver DefaultContent()
 {
     return(_targetLocator.DefaultContent());
 }