• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

httpunit javascript.EcmaError: createElement

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written a test class to test my web application. I use httpunit 1.7 libraries (httpunit.jar and other libraries like js-1.6R5.jar, etc)
When I run the test case, I get all the links which are present on my JSP. But when I try to invoke click() method of any link (WebResponse resp = registerLink.click() , I get the following error:
javascript.EcmaError: TypeError: Cannot find function createElement

Could someone tell me what might be cause of this and how to fix it?
Thanks.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Amit, if you peruse the HttpUnit JavaScript support documentation, you'll find that the Document#createElement() function is not supported.

If you have JavaScript on your pages, I'd recommend switching to HtmlUnit or jWebUnit (which uses HtmlUnit). They've got broaded support for JavaScript.
 
Amit kull
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Lasse.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic