WatiN,VBScript

时间:2009-03-23 05:08:35

标签: testing watin

我正在使用WatiN进行网络测试。在我的一个网页中,我有一个VBScript函数,可以打开一个对话框。我无法使用WatiN访问它。

我尝试过使用WatiNTestRecorder;这是不成功的。

我也尝试了这个: http://blogs.dovetailsoftware.com/blogs/kmiller/archive/2008/07/16/scenario-testing-with-watin.aspx,再次失败。

1 个答案:

答案 0 :(得分:1)

您是否尝试过VbScriptMsgBoxDialogHandler?下面是一个例子

        var handler = new VbScriptMsgBoxDialogHandler(buttonToPush);
    using(new UseDialogOnce(Ie.DialogWatcher, handler ))
    {
        Ie.Button("vbScriptMsgBox").ClickNoWait();
        handler.WaitUntilHandled(10);

                Assert.That(handler.HasHandledDialog, "Should have handled dialog");                
    }