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; }
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(); }