From: Elise L. <el...@ch...> - 2004-06-25 22:16:19
|
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 several nested frames, with the 2 main ones being app (which is what i'm testing) and test (which has some testing javascript functions and logging). Some of the app frames have a src=blank.html. A form is submitted and one of the app frames is updated with information using javascript. The problem is that I always end up in blank.html inseatd of the updated info. This is the test case: WebClient webClient = new WebClient(); URL url = new URL("http://127.0.0.1:8080/cudl/cudlQA.html"); // Get the test frames page HtmlPage main = (HtmlPage)webClient.getPage(url); List mainFrameset = main.getFrames(); HtmlFrame testFrame1 = (HtmlFrame)mainFrameset.get(1); HtmlPage test = (HtmlPage)testFrame1.getEnclosedPage(); HtmlFrame testFrame2 = (HtmlFrame)test.getFrames().get(0); HtmlPage testExec = (HtmlPage)testFrame2.getEnclosedPage(); //setup some fields in the form ((HtmlAnchor) testExec.getAnchors().get(0)).click(); //submit the form to update the display frame ((HtmlAnchor) testExec.getAnchors().get(2)).click(); //make sure that the page has time to reload Thread.sleep(1000 * 10); final HtmlFrame appFrame = ((HtmlFrame)mainFrameset.get(0)); final HtmlPage app = (HtmlPage)appFrame.getEnclosedPage(); List modelFrame = app.getFrames(); final HtmlPage display = (HtmlPage)((HtmlFrame)modelFrame.get(0)).getEnclosedPage(); System.out.println(display.getTitleText());the display page is blank.html. I see in the debugger that all frames are available but i always end up in blank.html. I thought that going back to the mainFrameset would give me an updated Frame but it doesn't. Does anyone see anything obvious? Thanks for your help! Elise |