OpenQA.Selenium.AlertsTest.ShouldAllowAUserToSetTheValueOfAPrompt C# (CSharp) Méthode

ShouldAllowAUserToSetTheValueOfAPrompt() private méthode

private ShouldAllowAUserToSetTheValueOfAPrompt ( ) : void
Résultat void
        public void ShouldAllowAUserToSetTheValueOfAPrompt()
        {
            driver.Url = alertsPage;

            driver.FindElement(By.Id("prompt")).Click();

            IAlert alert = driver.SwitchTo().Alert();
            alert.SendKeys("cheese");
            alert.Accept();

            string result = driver.FindElement(By.Id("text")).Text;
            Assert.AreEqual("cheese", result);
        }