watin

¿Puedo leer el cuadro de alerta de JavaScript con WatiN?



(1)

Quiero usar WatiN para verificar el mensaje de error en un cuadro de alerta de JavaScript. es posible? Gracias.


ver el Blog de Trev y aquí también.

using(IE ie = new IE("http://hostname/pagename.htm")) { AlertDialogHandler alertDialogHandler = new AlertDialogHandler(); using (new UseDialogOnce(ie.DialogWatcher, alertDialogHandler )) { /************************************* * -- alert -- * * * * must use the "NoWait" to allow * * the code to goto the next line * * * *************************************/ alertDialogHandler.WaitUntilExists(); alertDialogHandler.OKButton.Click(); ie.WaitForComplete(); } }