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 4087256
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:49:56+00:00 2026-05-20T18:49:56+00:00

I have a website and I’ve been trying to gather statistical data (mostly page

  • 0

I have a website and I’ve been trying to gather statistical data (mostly page render times) for the end user, for example: login time, search result time. I need something to mimic end-user activity.

So I did some searching and I came across HtmlUnit which seems to be able to do what I need. But I seem to be having trouble
Here is some text code that I pulled off of thier website:

import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

public class htmlUnit {
  public static void main(String[] args) throws Exception {
        final WebClient webClient = new WebClient();
        final HtmlPage page = webClient.getPage("http://google.ca");
        webClient.closeAllWindows();
  }
}

Seems to give this error:

Exception in thread “main”
org.apache.http.conn.HttpHostConnectException:
Connection to http://google.ca refused
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:127)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
…………………………………………..

1) Am I on the right track? or do I need to look into something else?

2) How do I fix this error.

  • 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-05-20T18:49:57+00:00Added an answer on May 20, 2026 at 6:49 pm

    You must have a firewall forbidding you to directly access google.ca from a Java application. Or you need to go through a proxy to access google.ca.

    Read http://htmlunit.sourceforge.net/gettingStarted.html for instructions about proxies and HtmlUnit.

    You’re on the right track if you want to simulate one user activity. If you need to load-test your application with several users, you should look at something else (Apache JMeter for example)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have website that shows user submitted content in 30+ languages in front page,I
i have website of application which sells applications online.on the home page i want
I'm trying to play on iPhone's Safari so i can have website menu bar
I have website with like button and facebook page that was created manually. I
I have website that will both post to a user's Facebook wall, and allow
I have website http://yournextleap.com/fresher-jobs Please find out last div having HTML <div data-recommendation= data-id=3790
i am calling iframe on html page within it i have website url, i
What if I have website with a button. User clicks on the button and
Situation: I have website which calls WCF Service and i'm trying to understand it..
I have website written in Rails. I constantly find myself tweaking page titles, intro

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.