public void MissingAlertExceptionTest()
        {
            Assert.AreEqual(0, Ie.DialogWatcher.Count, "DialogWatcher count should be zero before test");

            var dialogHandler = new AlertAndConfirmDialogHandler();

            using (new UseDialogOnce(Ie.DialogWatcher, dialogHandler))
            {
                dialogHandler.Pop();
            }
        }
        public void AlertAndConfirmDialogHandler()
        {
            DialogWatcher dialogWatcher;

            Assert.AreEqual(0, Ie.DialogWatcher.Count, "DialogWatcher count should be zero before test");

            // Create handler for Alert and confirm dialogs and register it.
            var dialogHandler = new AlertAndConfirmDialogHandler();

            using (new UseDialogOnce(Ie.DialogWatcher, dialogHandler))
            {
                Assert.AreEqual(0, dialogHandler.Count);

                Ie.Button("helloid").Click();

                Assert.AreEqual(1, dialogHandler.Count);
                Assert.AreEqual("hello", dialogHandler.Alerts[0]);

                // getting alert text
                Assert.AreEqual("hello", dialogHandler.Pop());

                Assert.AreEqual(0, dialogHandler.Count);

                // Test Clear
                Ie.Button("helloid").Click();

                Assert.AreEqual(1, dialogHandler.Count);

                dialogHandler.Clear();

                Assert.AreEqual(0, dialogHandler.Count);

                dialogWatcher = Ie.DialogWatcher;
            }

            Assert.AreEqual(0, dialogWatcher.Count, "DialogWatcher count should be zero after test");
        }