Beispiel #1
0
        public void do_action_on_alert()
        {
            Move_to_registration();
            Actions act = new Actions(driver);

            act.MoveToElement(switchto_text).Build().Perform();
            Alerttext.Click();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            click_to_getalert.Click();
            IAlert alert = driver.SwitchTo().Alert();
            string text  = alert.Text;

            Console.WriteLine(text);
            alert.Accept();
        }
Beispiel #2
0
        public void alertok_cancel()
        {
            Move_to_registration();
            Actions act = new Actions(driver);

            act.MoveToElement(switchto_text).Build().Perform();
            Alerttext.Click();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            Alert_ok_cancel.Click();
            alertwithtwo_btn.Click();
            IAlert alert = driver.SwitchTo().Alert();

            alert.Dismiss();
            string text = alertpressed_text.Text;

            Console.WriteLine(text);
        }
Beispiel #3
0
        public void Alert_with_textbox()
        {
            Move_to_registration();
            Actions act = new Actions(driver);

            act.MoveToElement(switchto_text).Build().Perform();
            Alerttext.Click();
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);
            alertwith_textbox.Click();
            buttonalert.Click();

            driver.SwitchTo().Alert().SendKeys("Hi");
            driver.SwitchTo().Alert().Accept();
            string gettext = alertpressed_text1.Text;

            Console.WriteLine(gettext);
            driver.Quit();
        }