[HtmlUnit] [htmlunit:feature-requests] #260 Javacript taking way too long time

RBRi via HtmlUnit-develop <[email protected]> Wed, 29 May 2019 19:00:05 -0000
Newsgroups gmane.comp.java.htmlunit.devel
Message-ID </p/htmlunit/feature-requests/260/33753fc3612f4e8b350115cd1924ce826cef90ea.feature-requests@htmlunit.p.sourceforge.net>
This is a multi-part message in MIME format.
--===============6180970946271386766==
Content-Type: multipart/related;
 boundary="===============7640547140266188534=="

This is a multi-part message in MIME format.
--===============7640547140266188534==
Content-Type: multipart/alternative;
 boundary="===============2899823291636727624=="
MIME-Version: 1.0

--===============2899823291636727624==
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

- **status**: open --> wont-fix



---

** [feature-requests:#260] Javacript taking way too long time**

**Status:** wont-fix
**Group:** 2.32
**Labels:** javascript Performance time 
**Created:** Wed May 29, 2019 09:38 AM UTC by Abhishek Thakur
**Last Updated:** Wed May 29, 2019 10:17 AM UTC
**Owner:** nobody


Hi There,


I am new to HtmlUnit and I am using this library to login/geo login with postcodes to different websites. I am able to login to websites but it is taking way too long(up to 5 mins). I need to have Javascript enabled to download the forms asyncronously. 

I am using below webclient configuration

        WebClient webClient = new WebClient(BrowserVersion.CHROME);

        WebClientOptions webClientOption = webClient.getOptions();
        webClientOption.setCssEnabled(false);
        webClientOption.setJavaScriptEnabled(true);
        webClientOption.setUseInsecureSSL(true);
        webClientOption.setTimeout(30000);
        webClientOption.setThrowExceptionOnScriptError(false);
        webClientOption.setThrowExceptionOnFailingStatusCode(false);
        webClientOption.setUseInsecureSSL(true);
        webClientOption.setActiveXNative(true);
        webClientOption.setAppletEnabled(true);
        webClientOption.setPopupBlockerEnabled(false);
        webClientOption.setRedirectEnabled(true);

        webClient.waitForBackgroundJavaScript(30000);
        webClient.waitForBackgroundJavaScriptStartingBefore(10000);
        webClient.setJavaScriptTimeout(30000);
        webClient.getCookieManager().setCookiesEnabled(true);
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());

          JavaScriptEngine scriptEngine = (JavaScriptEngine) webClient.getJavaScriptEngine();
        HtmlUnitContextFactory factory = scriptEngine.getContextFactory();
        Context context = factory.enterContext();
        context.setOptimizationLevel(9);
        
       
       
       This is happening with almost all the website I am trying to login. Any help in improving the time to run javascript will be greatly appreciated.
       
       
       
       Regards,
       Abhishek Thakur
        





---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/htmlunit/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/htmlunit/admin/feature-requests/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
--===============2899823291636727624==
MIME-Version: 1.0
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: 7bit

<div class="markdown_content"><ul>
<li><strong>status</strong>: open --&gt; wont-fix</li>
</ul>
<hr/>
<p><strong> <a class="alink strikethrough" href="https://sourceforge.net/p/htmlunit/feature-requests/260/">[feature-requests:#260]</a> Javacript taking way too long time</strong></p>
<p><strong>Status:</strong> wont-fix<br/>
<strong>Group:</strong> 2.32<br/>
<strong>Labels:</strong> javascript Performance time <br/>
<strong>Created:</strong> Wed May 29, 2019 09:38 AM UTC by Abhishek Thakur<br/>
<strong>Last Updated:</strong> Wed May 29, 2019 10:17 AM UTC<br/>
<strong>Owner:</strong> nobody</p>
<p>Hi There,</p>
<p>I am new to HtmlUnit and I am using this library to login/geo login with postcodes to different websites. I am able to login to websites but it is taking way too long(up to 5 mins). I need to have Javascript enabled to download the forms asyncronously. </p>
<p>I am using below webclient configuration</p>
<div class="codehilite"><pre><span></span>    WebClient webClient = new WebClient(BrowserVersion.CHROME);

    WebClientOptions webClientOption = webClient.getOptions();
    webClientOption.setCssEnabled(false);
    webClientOption.setJavaScriptEnabled(true);
    webClientOption.setUseInsecureSSL(true);
    webClientOption.setTimeout(30000);
    webClientOption.setThrowExceptionOnScriptError(false);
    webClientOption.setThrowExceptionOnFailingStatusCode(false);
    webClientOption.setUseInsecureSSL(true);
    webClientOption.setActiveXNative(true);
    webClientOption.setAppletEnabled(true);
    webClientOption.setPopupBlockerEnabled(false);
    webClientOption.setRedirectEnabled(true);

    webClient.waitForBackgroundJavaScript(30000);
    webClient.waitForBackgroundJavaScriptStartingBefore(10000);
    webClient.setJavaScriptTimeout(30000);
    webClient.getCookieManager().setCookiesEnabled(true);
    webClient.setAjaxController(new NicelyResynchronizingAjaxController());

      JavaScriptEngine scriptEngine = (JavaScriptEngine) webClient.getJavaScriptEngine();
    HtmlUnitContextFactory factory = scriptEngine.getContextFactory();
    Context context = factory.enterContext();
    context.setOptimizationLevel(9);

   This is happening with almost all the website I am trying to login. Any help in improving the time to run javascript will be greatly appreciated.

   Regards,
   Abhishek Thakur
</pre></div>


<hr/>
<p>Sent from sourceforge.net because htmlunit-develop<a class="user-mention" href="https://sourceforge.net/u/lists/">@lists</a>.sourceforge.net is subscribed to <a href="https://sourceforge.net/p/htmlunit/feature-requests/">https://sourceforge.net/p/htmlunit/feature-requests/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/htmlunit/admin/feature-requests/options.">https://sourceforge.net/p/htmlunit/admin/feature-requests/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>
--===============2899823291636727624==--
--===============7640547140266188534==--


--===============6180970946271386766==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============6180970946271386766==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
HtmlUnit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop

--===============6180970946271386766==--