在WatiN如何等到回发完成

Ser*_*jev 6 asp.net watin

在WatiN我怎么能等到回发完成.

例如:

// Postback response modifies update panel elsewhere on page
browser.Text("id").TypeText("asd"); 

// WatiN doesn't wait until postback is completed (what code should I replace it with?).
browser.WaitUntilComplete();
Run Code Online (Sandbox Code Playgroud)

gin*_*boy 11

您可以检查IE是否忙碌而不是完整.

while (((SHDocVw.InternetExplorerClass)(_ie.InternetExplorer)).Busy)
        {
            System.Threading.Thread.Sleep(2000);
        }
Run Code Online (Sandbox Code Playgroud)


Jer*_*nen 6

WaitUntilComplete无法识别ajax调用.请参阅本文(搜索WaitForAsyncPostBackToComplete),了解如何注入一些代码以使其工作:WatiN,Ajax和一些扩展方法

HTH,Jeroen