| Article: |
Unit Test Your Struts Application | |
| Subject: | Problem with StrutsUT | |
| Date: | 2004-10-26 23:41:56 | |
| From: | AshishDave | |
|
i am getting this error while working with strtusUT...can neone help me
|
||
Showing messages 1 through 1 of 1.
-
Problem with StrutsUT
2004-10-27 00:15:07 lujian213 [View]



1. Check your result html/jsp to see whether the contentType attribute is set to "text/html" or "text/plain". HttpUnit only accepts "text/html". Maybe you need to change the html/jsp.
2. If your struts action result is not a html, check the endXXX(WebResponse) method in your testcase. Use endXXX(org.apache.cactus.WebResponse) instead of endXXX(com.meterware.httpunit.WebResponse). This will avoid the test case to parse the result as a html format. Then you can use WebResponse.getText() to do comparation. Refer to Cactus document to get detail information.
If you still have problem, please provide related code, test case and related resource. I can check it for you.