Ejemplo n.º 1
0
        public void Frame()
        {
            _driver.Url = "http://toolsqa.com/iframe-practice-page/";
            var page = new ToolsQaStepscs(_driver);

            _driver.SwitchTo().Frame(_driver.FindElement(By.Name("iframe1")));
            var message = _driver.FindElement(By.CssSelector(".vc_message_box ")).Text;

            _driver.SwitchTo().DefaultContent();
            _driver.SwitchTo().Frame(_driver.FindElement(By.Name("iframe2")));
            var isDisplayed = _driver.FindElement(By.CssSelector(".site-anchor")).Enabled;
        }
Ejemplo n.º 2
0
        public void Alerts()
        {
            _driver.Url = "http://toolsqa.com/handling-alerts-using-selenium-webdriver/";
            var page = new ToolsQaStepscs(_driver);

            page.ClickAlertButton();
            WebDriverWait wait  = new WebDriverWait(_driver, TimeSpan.FromSeconds(10));
            var           alert = wait.Until(AlertIsPresent());

            alert.SendKeys("Test Text");
            alert.Accept();
        }