HTMLUnit doesn't wait for Javascript

后端 未结 4 538
面向向阳花
面向向阳花 2020-11-27 18:09

I have a GWT based page that I would like to create an HTML snapshot for it using HtmlUnit. The page loads using Ajax/JavaScript information on a product, so for about 1 sec

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 18:46

    Thank you for responding. I actually should have reported this sooner that I have found the solution myself. Apparently when initialising WebClient with FF:

    WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3_6);
    

    It seem to be working. When initialising WebClient with the default constructor it uses IE7 by default and I guess FF has better support for Ajax and is the recommended emulator to use.

提交回复
热议问题