From: Your G. <yo...@br...> - 2004-06-25 16:44:08
|
Try doing mainFrameset = main.getFrames(); again after you click Other than that I can't tell much without seeing the HTML Brad C --- Elise Lebeau <el...@ch...> wrote: > First, let me preface this with a comment that the code I am testing ain't > pretty. They're spitting out pages, within frames, by using document.write > for the whole thing, with some JSP sprinkled all over. Oh, and it's a MVC > model. > So let me try to narrow down the problem: > > I have 4 frames. All of which have a src=blank.html. Then a form is > submitted and one of the frames is updated with information. The problem i > am running into is that I always end up in blank.html for all the frames. > > This is the test case: > final WebClient webClient = new WebClient(); > final URL url = new > URL("http://127.0.0.1:8080/cudl/cudlQA.html"); > > // Get the first page > final HtmlPage main = (HtmlPage)webClient.getPage(url); > List mainFrameset = main.getFrames(); > final HtmlFrame testFrame = (HtmlFrame)mainFrameset.get(1); > final HtmlPage test = (HtmlPage)testFrame.getEnclosedPage(); > > //this setups some fields in the form > ((HtmlAnchor) test.getAnchors().get(0)).click(); > ((HtmlAnchor) test.getAnchors().get(1)).click(); > //this submits the form to update the display frame > ((HtmlAnchor) test.getAnchors().get(2)).click(); > > //this is to make sure that the page has time to reload > Thread.sleep(1000 * 20); > > final HtmlFrame cudlQAFrame = ((HtmlFrame)mainFrameset.get(0)); > final HtmlPage cudlQA = (HtmlPage)cudlQAFrame.getEnclosedPage(); > List modelSelectDebugFrame = cudlQA.getFrames(); > final HtmlPage display = > (HtmlPage)((HtmlFrame)modelSelectDebugFrame.get(2)).getEnclosedPage(); > System.out.println(display.getTitleText()); > > the display page is blank.html. > I thought that going back to the mainFrameset would give me an updated Frame > but it doesn't. > Thanks for your help! > > Elise > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Htmlunit-user mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |