package com.github.emalock3.htmlunit;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.SilentCssErrorHandler;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import java.io.IOException;

public class Main {
    public static void main(String... args) throws IOException {
        WebClient webClient = new WebClient(BrowserVersion.FIREFOX_24);
        webClient.setCssErrorHandler(new SilentCssErrorHandler());
        HtmlPage page = webClient.getPage("http://localhost:8080/");
        System.out.println(page.asXml());
    }
}

@@ -85,16 +85,90 @@
 ersion;%0A
+import com.gargoylesoftware.htmlunit.NicelyResynchronizingAjaxController;%0A
 import c
@@ -568,24 +568,440 @@
 Handler());%0A
+        webClient.setAjaxController(new NicelyResynchronizingAjaxController());%0A        webClient.getOptions().setCssEnabled(true);%0A        webClient.getOptions().setRedirectEnabled(false);%0A        webClient.getOptions().setAppletEnabled(false);%0A        webClient.getOptions().setJavaScriptEnabled(true);%0A        webClient.getOptions().setPopupBlockerEnabled(true);%0A        webClient.getOptions().setTimeout(10000);%0A
         Html
@@ -1095,20 +1095,57 @@
 e.asXml());%0A
+        webClient.closeAllWindows();%0A
     %7D%0A%7D%0A

Add options