Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7717477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:54:34+00:00 2026-06-01T02:54:34+00:00

I am trying to use a headless browser in .Net and I need it

  • 0

I am trying to use a headless browser in .Net and I need it to execute JavaScript because the information I need to read with it is loaded via AJAX. After some research I believe my best option is HtmlUnit. I have followed the instructions in Steven Sanderson’s blog http://blog.stevensanderson.com/2010/03/30/using-htmlunit-on-net-for-headless-browser-automation/ in the main this works great. However, as hard as I try I cannot get it to wait for the JavaScript to load. Essentially after selecting something from a selectbox an AJAX request fires and populated another selectbox. HtmlUnit never sees the new options.

I have tried combinations of all of the examples in the FAQ http://htmlunit.sourceforge.net/faq.html#AJAXDoesNotWork so I can only assume that it is a problem with the fact it has been converted to run in .Net. I am hoping someone has some experience in this who can shed some light on what is wrong. I feel like I am going the right way with HtmlUnit and it has been recommended on here before Is there a headless browser for .NET (for automated Web-UI-Tests)? and headless internet browser? but I have reached a dead end.

So if anyone has either a better choice for a headles browser that supports JavaScript, and ideas how to get HtmlUnit to wait for the JavaScript or even just some advice on how to debug this further.

Thanks.

Simon

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:54:35+00:00Added an answer on June 1, 2026 at 2:54 am

    I think you need to use webClient.waitForBackgroundJavaScript() or webClient.waitForBackgroundJavaScriptStartingBefore().

    You can also see these links that might help you little.

    1. HTMLUnit doesn't wait for Javascript
    2. HtmlUnit doesn't load externally referenced javascript
    3. htmlunit javascript question
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use GnuPG with Delphi (Win32). I need to sign some file with
I am trying use javascript regular expressions to do some matching and I found
I am trying use a javascript function while passing php variables in it. For
I am trying use a javascript function while passing php variables in it. For
I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
I'm trying to get my Android tests running on headless emulator for future use
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying use a Java Uploader in a ROR app (for its ease

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.