File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Testing and the fly likes JWebUnit: Assertionfailed (missing form) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "JWebUnit: Assertionfailed (missing form)" Watch "JWebUnit: Assertionfailed (missing form)" New topic

JWebUnit: Assertionfailed (missing form)

Matt Jonzon

Joined: May 22, 2007
Posts: 1
Hello everyone, i am using JWebUnit for testing of JSP-pages.

I get an the following error when trying to click a button:

junit.framework.AssertionFailedError: No form present

But the button is no submit button, but rather a button with the onclick attribute.

Do I really have to use a form? This is the test method:

Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
It would help if you'd post the HTML for the FORM element within which the onclick-wired "button" is.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: JWebUnit: Assertionfailed (missing form)
It's not a secret anymore!