File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Testing and the fly likes HttpUnit to test JSF applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Testing
Bookmark "HttpUnit to test JSF applications" Watch "HttpUnit to test JSF applications" New topic
Author

HttpUnit to test JSF applications

Abhijit Sontakey
Ranch Hand

Joined: Sep 26, 2005
Posts: 67
Hi,
I am using HttpUnit to perform automated testing of web applications uilt using JSF framework. However i am unable to test components of JSF framework that involve more than 1 screens and passing arguments from more than 1 component to other. I tried getting Webform from Webresponse and using WebForm.submit() to navigate to another screen, but this doesn't work.Can anybody help. Any help will be appreciated.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
How does the WebForm.submit() not work? How does the generated HTML for the submit button look like?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Abhijit Sontakey
Ranch Hand

Joined: Sep 26, 2005
Posts: 67
Hi,
The submit button looks as mentioned below

button name='submit_search_0' on..click.=setKeys(event)
However the actual problem is i am getting a Response from a request and retrieving the webForm from the request. After retrieving the WebForm from WebResponse, i am submitting the form.
As can be seen from the code, button is calling a javascript function that calls a method in the Component class. Hence when i submit the form, it simply loads its again.
Abhijit Sontakey
Ranch Hand

Joined: Sep 26, 2005
Posts: 67
Hi,
The submit button looks as mentioned below

button name='submit_search_0' on..click.=setKeys(event)
However the actual problem is i am getting a Response from a request and retrieving the webForm from the request. After retrieving the WebForm from WebResponse, i am submitting the form.
As can be seen from the code, button is calling a javascript function that calls a method in the Component class. Hence when i submit the form, it simply loads its again.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HttpUnit to test JSF applications