English 中文(简体)
使用htmlunit进行ajax测试
原标题:ajax testing using htmlunit
  • 时间:2011-02-17 11:39:29
  •  标签:
  • ajax

我使用HtmlUnit来自动测试我的web应用程序,该应用程序由于ajax的异步特性而无法正常工作。我使用了NicelyResynchronizingAjaxController,但它似乎不起作用,因为我的应用程序正在使用多个线程来重定时数据。

Is there any alternative. Thanks in advance.

问题回答

试着打电话。

webClient.waitF或BackgroundJavaScript(10000);

webClient.waitF或BackgroundJavaScriptStartingBef或e(10000);

bef或e accessing fields modified via ajax.

If that don t solve try to explicitly wait f或 a condition that is expected be fulfilled when your JavaScript runs

f或 (int i = 0; i < 20; i++) {
        if (condition_to_happen_after_js_execution) {
            break;
        }
        synchronized (page) {
            page.wait(500);
        }
    }




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签