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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:22:48+00:00 2026-06-11T04:22:48+00:00

I am trying to learn HTTPUnit and have read cookbook mentioned on http://httpunit.sourceforge.net/doc/cookbook.html But

  • 0

I am trying to learn HTTPUnit and have read cookbook mentioned on http://httpunit.sourceforge.net/doc/cookbook.html

But when I am trying this very simple code

package httpUnit.test;    
import java.io.IOException;
import org.xml.sax.SAXException;
import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebLink;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;

/*** Hello world!**/

public class App{
    public static void main( String[] args ) throws IOException, SAXException {
        System.out.println( "Trying HTPUnit library");
        WebConversation wc = new WebConversation();
        WebRequest req = new GetMethodWebRequest("http://localhost:8080/proof/demo.html");
        WebResponse resp = wc.getResponse(req);

        /* WebLink[ ] link = resp.getLinks();
        for (int i=0; i<link.length; i++) {                                 
            System.out.println(link[i].getText());
        }
        System.out.println(link.length);
        */
    }
};

I am getting the following errors:

TypeError: undefined is not a function. (httpunit; line 15)
at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:597)
at org.mozilla.javascript.NativeGlobal.constructError(NativeGlobal.java:557)
Error continues.....

and

Exception in thread "main" com.meterware.httpunit.ScriptException: Script '/*!
* jQuery JavaScript Library v1.6
* http://jquery.com/

Can somebody please figure out what could be the problem. I could not understand. I have created the maven project with maven dependency from http://mvnrepository.com/artifact/httpunit/httpunit/1.6.1

And I have hosted demo.html in proof folder in tomcat which is opening fine in browser.

  • 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-11T04:22:49+00:00Added an answer on June 11, 2026 at 4:22 am

    I think the problem is with javascript only.

    Checkout http://httpunit.sourceforge.net/doc/faq.html#javascript

    And use HttpUnitOptions.setScriptingEnabled(false);

    I think it will do.

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

Sidebar

Related Questions

trying to learn and practice arrays but I have a problem with this small
I am somewhat new to jQuery but have been having fun trying learn about
Trying to learn a bit about PDO and is going through this tutorial .
Trying to learn about php's arrays today. I have a set of arrays like
Im trying to learn a bit about c++ and have run in to some
Trying to learn F# but got confused when trying to distinguish between fold and
Trying to learn Django, I closed the shell and am getting this problem now
trying to learn some html/css and I'm having a problem with fixed position divs.
While trying to learn c++, I tried to implement class representing very basic trie.
I trying to learn OOP and I've made this class class boo{ function boo(&another_class,

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.