The following doesn't work:
page.executeJavaScript( "$(document).ready(function() { console.info('test'); });" );
But if I unwrap the jquery ready function, it works as expected:
page.executeJavaScript( "console.info('test');" );
After more testing it seems there is a race condition: reloading a page with external script (<script src=...) causes the loaded javascript to run the document ready code sometimes.
Jquery 3.5.1
HtmlUnit 2.45.0
The following doesn't work:
page.executeJavaScript( "$(document).ready(function() { console.info('test'); });" );But if I unwrap the jquery ready function, it works as expected:
page.executeJavaScript( "console.info('test');" );After more testing it seems there is a race condition: reloading a page with external script (
<script src=...) causes the loaded javascript to run the document ready code sometimes.Jquery 3.5.1
HtmlUnit 2.45.0