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
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too