Ejemplo n.º 1
0
        public void DismissAlertTest()
        {
            var elementActions = new ElementActions(Driver);

            Driver.Url = "http://the-internet.herokuapp.com/";
            elementActions.Click(By.XPath("//a[text()='JavaScript Alerts']"));
            elementActions.Click(By.XPath("//button[text()='Click for JS Confirm']"));
            Assert.IsTrue(elementActions.IsAlertDisplayed(), "Alert wasn't displayed.");
            elementActions.DismissAlert();
            Assert.IsFalse(elementActions.IsAlertDisplayed(), "Alert was still displayed.");
        }
Ejemplo n.º 2
0
        public void IsAlertDisplayedTest()
        {
            var elementActions = new ElementActions(Driver);

            Driver.Url = "http://the-internet.herokuapp.com/";
            elementActions.Click(By.XPath("//a[text()='JavaScript Alerts']"));
            elementActions.Click(By.XPath("//button[text()='Click for JS Alert']"));
            elementActions.WaitForAlertToBeVisible(30);
            Assert.IsTrue(elementActions.IsAlertDisplayed(), "Alert wasn't displayed.");
        }