This may be an issue with javascript.

Try the following and see what happens.
            HttpUnitOptions.setExceptionsThrownOnScriptError(false);

1) This may be an error with the javascript parsing of httpunit.... or its
required jar files.

2) Maybe a classpath issue.

Just a thought.  HTH.

Nick

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 29, 2004 1:23 PM
> To: [EMAIL PROTECTED]
> Subject: [Jwebunit-users] Exceptions when running simple test case
> 
> 
> Hello,
> 
> I am new to using the JWebUnit framework and a fairly novice Java
> programmer as well so please bear with me.
> 
> I was trying to implement a simple test of a web site, 
> basically following
> along with the "Quick start" tutorial.  My code is as follows:
> 
> BoxcarWebTestCase.java:
> 
> import net.sourceforge.jwebunit.WebTestCase;
> 
> public class BoxcarWebTestCase extends WebTestCase {
>     private static String BASE_URL = 
> "http://www.terrorware.com:80/shop";;
> 
>     public BoxcarWebTestCase(String name) {
>         super(name);
>         getTestContext().setBaseUrl(BASE_URL);
> 
>     }
> 
>     public void testMainPage() {
>        beginAt("/testcase.html");
>     }
> 
>     public static void main(String[] args) {
>        BoxcarWebTestCase tester = new BoxcarWebTestCase("test1");
>        tester.testMainPage();
>     }
> }
> 
> Running this code throws the following exception:
> 
> [EMAIL PROTECTED]:~/online_inventory_tests$ java BoxcarWebTestCase
> Exception in thread "main" java.lang.VerifyError: (class:
> com/meterware/httpunit/javascript/JavaScript$ElementArray, method:
> newElementArray signature:
> (Lorg/mozilla/javascript/Scriptable;)Lcom/meterware/httpunit/j
> avascript/JavaScript$ElementArray;)
> Incompatible argument to function
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:164)
>         at
> com.meterware.httpunit.javascript.JavaScript.class$(JavaScript
> .java:86)
>         at
> com.meterware.httpunit.javascript.JavaScript.initHTMLObjects(J
> avaScript.java:98)
>         at
> com.meterware.httpunit.javascript.JavaScript.run(JavaScript.java:77)
>         at
> com.meterware.httpunit.javascript.JavaScriptEngineFactory.asso
> ciate(JavaScriptEngineFactory.java:46)
>         at 
> com.meterware.httpunit.FrameHolder.<init>(FrameHolder.java:44)
>         at com.meterware.httpunit.WebWindow.<init>(WebWindow.java:218)
>         at com.meterware.httpunit.WebClient.<init>(WebClient.java:50)
>         at
> com.meterware.httpunit.WebConversation.<init>(WebConversation.java:46)
>         at
> net.sourceforge.jwebunit.TestContext.getWebClient(TestContext.
> java:260)
>         at
> net.sourceforge.jwebunit.HttpUnitDialog.initWebClient(HttpUnit
> Dialog.java:55)
>         at
> net.sourceforge.jwebunit.HttpUnitDialog.<init>(HttpUnitDialog.java:46)
>         at 
> net.sourceforge.jwebunit.WebTester.beginAt(WebTester.java:55)
>         at 
> net.sourceforge.jwebunit.WebTestCase.beginAt(WebTestCase.java:46)
>         at BoxcarWebTestCase.testMainPage(BoxcarWebTestCase.java:13)
>         at BoxcarWebTestCase.main(BoxcarWebTestCase.java:18)
> 
> If anybody is familiar with this problem or can see what I'm 
> doing wrong,
> please let me know.  It's such a simple piece of code, I 
> imagine that the
> problem is with my installation of jWebUnit and its 
> dependencies rather
> than with the code.  In case it's relevent, my classpath is 
> as follows:
> 
> [EMAIL PROTECTED]:~/online_inventory_tests$ echo $CLASSPATH
> :/home/httpd/vhost/boxcarbooks.org/local/httpunit-1.5.4/lib/ht
tpunit.jar:/home/httpd/vhost/boxcarbooks.org/local>
/junit3.8.1/junit.jar:/home/httpd/vhost/boxcarbooks.org/local/
> nekohtml-0.9.3/nekohtml.jar:/home/httpd/vhost/boxcarbooks.org/
> local/rhino1_5R5/js.jar:/home/httpd/vhost/boxcarbooks.org/loca
> l/xerces-2_6_2/xercesImpl.jar:/home/httpd/vhost/boxcarbooks.or
> g/local/xerces-2_6_2/xml-apis.jar:/home/httpd/vhost/boxcarbook
> s.org/local/jakarta-servletapi-4/lib/servlet.jar:/home/httpd/v
> host/boxcarbooks.org/local/jwebunit-1.2/jwebunit-1.2.jar
> 
> Any hope that can be provided would be greatly appreciated.
> 
> Thanks,
> Geoff
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on 
> ITManagersJournal
> Use IT products in your business? Tell us what you think of 
> them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to 
> find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Jwebunit-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jwebunit-users
> 


- - - - - - 
This e-mail message is intended only for the use of the individual or entity
identified in the alias address of this message and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution of this e-mail message is strictly prohibited. If you have
received this e-mail message in error, please notify the sender immediately
by reply e-mail and delete this message from your system. Thank you.


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Jwebunit-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to