开发者

DomContainer.Eval to open popup does not return

开发者 https://www.devze.com 2023-03-30 10:30 出处:网络
I am calling a script to open up an alertbox using Eval function like below: ie.DomContainer.Eval(\"alert(\'just a test\')\");

I am calling a script to open up an alertbox using Eval function like below:

ie.DomContainer.Eval("alert('just a test')");

However this does not return and it hangs there. Any other javascript ca开发者_运维问答ll in Eval works fine as long as it does not produce a popup. Does anyone know how to close the alertbox or modal dialog that results from eval?

I am using IE9, Watin 2.1.0.1196.

Thanks.


Using Watin 2.0 / IE8, the popup closes automatically. Can you try the very basic test as listed below?

My NUnit test is as follows.

    [Test]
    public void EValTest()
    {
        IE myIE = new IE(true);
        myIE.GoTo("www.google.com");
        myIE.DomContainer.Eval("alert('just a test')");
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号