Re: included javascript files

Russell Gold <[email protected]> Fri, 20 Jun 2008 10:09:01 -0400
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
The problem is that HttpUnit's support for Javascript is incomplete -  
you have run into something not currently supported. Filling those  
gaps is the focus of the HttpUnit effort at this time, but it could  
take a few months. It has nothing to do with included javascript files.


On Jun 20, 2008, at 6:02 AM, Jakub Światły wrote:

> Hello,
>
> I'm writing tests of JSP based application using HttpUnit 1.7.
> Everything works fine untill i try i to run javascript that uses
> functions defined in external .js file. There are no linkage errors,
> looks like the function was found but it is not called and it returns
> with null (i think). Can anyone tell me how to solve this? I can
> provide any details you want.
>
> Thanks in advance for your help.
> Kuba Światły
>
> example:
>
> .jsp file:
>
> <script src="/docusafe/functions.js"></script>
>
> (...)
>
> <script language="JavaScript">
>       function submitPerson()
>       {
>           (...)
>
>           person.location = id('location').value;
>           person.country = getSelectedOption(id('country')).value;
>           person.email = id('email').value;
>
>           return true;
>       }
>
>       function id(id)
>       {
>           return document.getElementById(id);
>       }
>
> </script>
>
> (...)
>
> <input type="button" value="Umieść w formularzu" onclick="if
> (!submitPerson()) return false; window.close();" class="btn"/>
>
>
>
> where function getSelectedOption() is defined in file functions.js:
>
> function getSelectedOption(sel)
> {
>   return sel.options[sel.options.selectedIndex];
> }
>
>
> when I call click() on the button I get:
>
> org.mozilla.javascript.EcmaError: TypeError: Cannot read property
> "value" from undefined (httpunit#28)
>
> I've traced execution and this exception is thrown while interpreting
> line: person.country = getSelectedOption(id('country')).value;
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Httpunit-develop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/httpunit-develop


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop