Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

HttpUnit Testing

Posted on 2004-11-16
7
Medium Priority
?
394 Views
Last Modified: 2012-05-05
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 = "/something.do">
<table>
<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>
</td></tr>
</table>

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.

Thanks

Ramani



0
Comment
Question by:ramani081399
  • 4
  • 2
7 Comments
 
LVL 8

Expert Comment

by:kiranhk
ID: 12596081
if you have Struts then u would be better off using StrutsTestCase

This has all the info for testing your jsp

http://strutstestcase.sourceforge.net/
0
 

Author Comment

by:ramani081399
ID: 12596825
Kiranhk,
   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.
Ramani
0
 
LVL 8

Expert Comment

by:kiranhk
ID: 12596936
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
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:ramani081399
ID: 12597505
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

Ramani
0
 
LVL 29

Expert Comment

by:bloodredsun
ID: 12851866
Have you considered Cactus?
http://jakarta.apache.org/cactus/

It provides the extension for JUnit testing but for severside code such as servlets or jsps

http://enhydra.objectweb.org/doc/5.1/Tools/Cactus/howto_jsp.html : for a jsp specific article
0
 
LVL 8

Accepted Solution

by:
kiranhk earned 500 total points
ID: 12852059
bloodredsun

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

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

http://www.onjava.com/pub/a/onjava/2004/09/22/test-struts.html?page=last

http://www.devx.com/Java/Article/20198/1954?pf=true

http://javaboutique.internet.com/tutorials/StrutsTestCase/
0
 
LVL 8

Expert Comment

by:kiranhk
ID: 13405397
can you close this question... its been more than 3 months...........
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The number of companies understanding the potential of IoT on B2B market is growing with each day. And yet only a small share of IoT developers have managed to equalize incomes and stay competitive in the international market.
Don’ts and Dos are two important end products of software testing basics that a tester needs to regard. This article attempts to explain the principles of both.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question