有没有办法阻止WatIn超时?

有没有办法阻止WatIn超时?

问题描述:

由于未知原因,登录应用程序所花费的时间已显着增加。这通常不会成为问题;然而,我没有做任何事情似乎阻止Watin超时。有没有办法阻止WatIn超时?

单击“登录”按钮后,最长可能需要1分钟才能显示主页。我尝试了几个thigs:

ieInUse.Button(Find.ByValue(“Log On”))。Click();

ieInUse.WaitUntilContainsText(“主页上的文本”); 。

或类似的东西...

ieInUse.Button(Find.ByValue( “登录”))点击();

ieInUse.WaitForComplete(100000);在等待文件状态完全超时:

但还是测试失败,出现错误:

WatiN.Core.Exceptions.TimeoutException。 Last state was'loading'

在初始化ie对象之前使用此watin设置来增加超时。

Settings.AttachToBrowserTimeOut = 240; //240 seconds 
    Settings.WaitUntilExistsTimeOut = 240; 
    Settings.WaitForCompleteTimeOut = 240; 

我肯定是来不及回答,但我问自己同样的问题,结果发现在华廷2.0发行说明一个答案:

Previous versions of WatiN would wait until IE and the DOM document got into the ‘ready’ state. More and more websites never reach this state for instance because of adds constantly loading. WatiN will now wait for IE and the DOM Document to get to the ‘interactive’ or ‘ready’ state to avoid unnecessary time-outs, and to be more responsive.

http://watin.org/documentation/release-2-0-50-11579/

所以检查版本你正在使用。希望这可以帮助某人。