HttpUnit Testing

I am trying to write HttpUnit test case for a JSP page. The JSP page is a Struts JSP page with struts tags. The JSP page has following structure
< html: form action = "/">
<tr><td><html:text property = "prop1" />Prop1</td></tr>
<tr><td><html:text property = "prop2" />Prop2</td></tr>
<tr><td><html:image alt = "Add" src= "../images/add.gif" property="add"></html:image>

I would the testcase to show the clicking of the add button. How do I do this?? I am not able it to recognise the source of the image and invoke submit . Any sample code that would tell me how to do this would be good.



Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

if you have Struts then u would be better off using StrutsTestCase

This has all the info for testing your jsp
ramani081399Author Commented:
   I have gone to this site and I dont find any useful material. I need to test my JSP pages.
   So, I need to still solve my problem.
what do u mean didnt fine any userful material. r u looking for something which validates your JSP to see if everything is correct in the JSP or do you want to test whether the control is going proprely to the jsp's
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

ramani081399Author Commented:
Yes the link that u mention does not give me the code to start off. I need to test the JSP page in a portlet environment. I can get all other things like validation and checking if the fields exist or not in the JSP page

Have you considered Cactus?

It provides the extension for JUnit testing but for severside code such as servlets or jsps : for a jsp specific article

Strutstestcase is built on top of Cactus Mock Objects....

Anyway the sample code for StrutsTestCase can be found in these articles

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
can you close this question... its been more than 3 months...........
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.