Re: [Httpunit-develop] Refreshing an individial frame
Brought to you by:
russgold
|
From: Russell G. <rus...@ht...> - 2003-03-28 19:01:23
|
At 12:37 PM 3/27/2003 +0000, Andrew Bickerton wrote: >Hi Russ, > >I'm trying to figure out a way to refresh the contents of an individual frame >within HttpUnit, in the same way as you can do in the IE browser by right- >clicking in the frame and selecting 'refresh'. Refreshing the whole page >seems easy enough (by calling WebClient.getResponse with the URL of the >current page's WebResponse), but I can't see any way currently of refreshing >just a single frame. > >If you can give me some guidance, I'd be very keen to put forward a >contribution on this, as it would greatly help the testing we're doing. Brute force, you can always create a request with the desired frame's target and URL. As long as there is no body, this will suffice (and you usually don't want to refresh pages with message bodies). A cleaner approach might be to add a 'refresh' method to WebWindow (and of course a convenience method to WebClient), passing in the frame name. This could be tested by defining the original contents, load the response, redefining the contents of two frames and then refreshing only one of them. Handling refreshes of pages with message bodies would be a bit tricker - it might require creating the response with a reference to the original request, and I have not looked to see if there would be any implications to doing that. |