public void Execute(IActor actor)
        {
            var driver = actor.Artifacts.Get <IWebDriver>();

            var element = _selector.Find(driver, driver);

            element.SendKeys(_text);
        }
예제 #2
0
        public void Execute(IActor actor)
        {
            if (actor == null)
            {
                throw new ArgumentNullException(nameof(actor));
            }

            var context = actor.Artifacts.Get <IWebDriver>();

            _elementSelector.Find(context, context).Submit();
        }
예제 #3
0
        public static IDisposable UseFrame(this IWebDriver driver, IElementSelector selector)
        {
            if (driver == null)
            {
                throw new ArgumentNullException(nameof(driver));
            }
            if (selector == null)
            {
                throw new ArgumentNullException(nameof(selector));
            }

            driver.SwitchTo().Frame(selector.Find(driver, driver));

            return(new DisposableAction(() => driver.SwitchTo().DefaultContent()));
        }
예제 #4
0
        public void Execute(IActor actor)
        {
            if (actor == null)
            {
                throw new ArgumentNullException(nameof(actor));
            }

            var driver = actor.Artifacts.Get <IWebDriver>();

            var element = _selector.Find(driver, driver);

            if (element == null)
            {
                throw new ExpectationException("Can't find element: " + _selector.GetElementDescription());
            }

            element.Click();
        }
        public void Execute(IActor actor)
        {
            if (actor == null)
            {
                throw new ArgumentNullException(nameof(actor));
            }

            var driver = actor.Artifacts.Get <IWebDriver>();

            if (_elementSelector != null)
            {
                driver.SwitchTo().Frame(_elementSelector.Find(driver, driver));
                return;
            }

            if (_useDefaultContent)
            {
                driver.SwitchTo().DefaultContent();
            }
        }