>> I've succeeded in making a HtmlUnit test that logs into my web app.
>> The response page is divided into 3 frames. How can I get the
>> contents of a frame so I can verify them? I've tried calling various
>> functions, but I can't find one that will return the contents:
>>
>> oFrame: HtmlFrame[<frame name="leftPane" noresize="" src=":leftPane">]
>> oFrame.asText():
>> oFrame.asXml(): <frame name="leftPane" noresize="" src=":leftPane"/>
>> oFrame.getChildElements(): []
>> webClient.getWebWindowByName("leftPane"): HtmlFrame[<frame
>> name="leftPane" noresize="" src=":leftPane">]
>
> All the various frames are subclasses of WebWindow which has the
> method getEnclosedPage(). Assuming that the page is html, it will
> return an HtmlPage object which will have the content you are
> looking for.
>
> Does this help?
Yes, that was the clue I needed. I found that with code like
HtmlPage filesPane = (HtmlPage)
webClient.getWebWindowByName("files").getEnclosedPage();
I can get directly to the content of my frame (which is named "files").
Thanks,
Steve
|