| Author |
Test html:cancel with STRUTSTESTCASE
|
Jiao Yu
Greenhorn
Joined: Oct 27, 2003
Posts: 7
|
|
Hello, If my jsp page, I have two buttons, one is html:submit, the other one is html:cancel, how could I create a test case for html:cancel? In my Action, I am using :if (isCancelled(request)) to determine whether the html:cancel is pushed, but I don't know how to setup this html:cancel button in my testcase. BTW, I am using mocktestcase Thanks a lot and have a great day, Jiao
|
 |
Jiao Yu
Greenhorn
Joined: Oct 27, 2003
Posts: 7
|
|
Hello, I have figured it out, basically, ActionServlet decides whether the user clicks the cancel button by checking a request parameter with the key of "org.apache.struts.taglib.html.CANCEL" in resource bundle. So if we add following request parameter in our testcase: addRequestParameter(Constants.CANCEL_PROPERTY,"CANCEL"); This behaviour is emulated. Thanks and have a great day, Jiao
|
 |
 |
|
|
subject: Test html:cancel with STRUTSTESTCASE
|
|
|