« Return to Thread: "Form" is not a constructor

RE: Re: "Form" is not a constructor

by Ben Kyrlach :: Rate this Message:

Reply to Author | View in Thread

I've also experienced this problem before. Unfortunantly, I was unable to isolate the problematic code from the application under test. If you're using "prototype.js" (a standard javascript library it seems) I've found that a simple modification to that JS file solved my problem.

I havn't been able to fully investigate the problem, but it does seem to have something to do with class prototyping in JavaScript confusing HTMLUnit. Unfortunantly, I think Marc was having a bad day that day, and I didn't get much help here. If you want to see where exactly I modified the file, I'll be happy to show you.

Thanks,

Ben Kyrlach -- Operations Intern.

-----Original Message-----
From: htmlunit-user-admin@...
[mailto:htmlunit-user-admin@...]On Behalf Of Marc
Guillemot
Sent: Monday, December 12, 2005 5:10 AM
To: htmlunit-user@...
Subject: [Htmlunit-user] Re: "Form" is not a constructor


Hi Thomas,

is

currentForm = document.getElementById("formName");

really the code at line 105 in your js file?

Can you try to produce a minimal html/js reproducing the problem?

Marc.

Thomas Robbs wrote:

> I’ve recently come across a problem when the JavaScriptEngine.execute(…)
> method executes the following line of JavaScript:
>
>  
>
> currentForm = document.getElementById("formName");
>
>  
>
> … where “formName” is the id of a form on the page.
>
>  
>
> The exception that is thrown is:
>
>  
>
> org.mozilla.javascript.WrappedException: Wrapped
> com.gargoylesoftware.htmlunit.ScriptException: "Form" is not a
> constructor. (/javascript file name/#105) (/javascript file name/ #105)
>
>  
>
> I’m using the following BrowserVersion:
>
>  
>
>     public static final BrowserVersion IE_6_0_SP2_on_WINXP_SP2 = new
> BrowserVersion(
>
>         BrowserVersion.INTERNET_EXPLORER, "4.0 (compatible; MSIE 6.0;
> Windows NT 5.1; SV1; .NET CLR 1.1.4322)",
>
>         "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
> CLR 1.1.4322)", "1.2", 6 );
>
>  
>
> I’ve walked through the functionality using the real browser that the
> above BrowserVersion represents as well as FireFox 1.0.7 and I’m not
> seeing any JavaScript errors on the page when it loads.
>
>  
>
> I’m also using a build of HtmlUnit 1.7 from 2005-12-05.
>
>  
>
> Any ideas as to what would cause this Exception?
>
>  
>
> Thanks in advance,
>
>  
>
> Tom
>
>  
>
>  
>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Htmlunit-user mailing list
Htmlunit-user@...
https://lists.sourceforge.net/lists/listinfo/htmlunit-user

 « Return to Thread: "Form" is not a constructor