| Author |
Question on JWebUnit: test Link parameter
|
Melinda Savoy
Ranch Hand
Joined: Jun 21, 2005
Posts: 375
|
|
I am using JWebUnit and was wondering if there is a way to test the following: First I want to test that the parameters ("num" and "type") are populated Second I want to test and compare their actual value. In my JSP page here is what I am working with: <td align="right"><a href='./ViewRequisitionServlet?num=<%= reqs[i].getReqNumber()%> &type=<%=reqs[i].getType() %>' name='<%= "LINK" + reqs[i].getReqNumber() %>' id='<%= "linkname" %>'> <%= reqs[i].getReqNumber() %></a></td> Any help or direction would be appreciated. Thanks.
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
You could ask jWebUnit for a HttpUnitDialog, ask the HttpUnitDialog for the WebResponse, and ask the WebResponse for the WebLink with ID "linkname", and then ask the WebLink for the value of the parameters you're interested in.
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
Melinda Savoy
Ranch Hand
Joined: Jun 21, 2005
Posts: 375
|
|
Lasse, Thanks for the reply. I'll try it. Regards.
|
 |
Melinda Savoy
Ranch Hand
Joined: Jun 21, 2005
Posts: 375
|
|
Lasse, That got it. Thanks for your help.
|
 |
 |
|
|
subject: Question on JWebUnit: test Link parameter
|
|
|