Adwait
Adwait

Reputation: 23

Automate javascript prompt using watin

I am automating a Javascript prompt by Watin. The prompt is displayed on button click.

I am using

button.click(); //the button click action

using (new UseDialogOnce(ie.DialogWatcher, alertDialogHandler))
                    {
                       alertDialogHandler.WaitUntilExists();
                       alertDialogHandler.OKButton.Click();
                       ie.WaitForComplete();
                    }

to handle the prompt. My problem is after the click, the control does not go to the next line where i have used alertDialogHandler.WaitUntilExists();

I have to manually handle the prompt. Is there a way to automate the prompt?

Upvotes: 0

Views: 294

Answers (1)

Sham
Sham

Reputation: 840

Instead of button.click(), use button.ClickNoWait() and check.

Upvotes: 1

Related Questions