From: Elise L. <el...@ch...> - 2004-06-28 17:08:36
|
I tried, didn't work. As for the html, this is kinda big but i'll just copy the frame information, to see if there is something obviously wrong... Thx! E this is the start point (cudlQA) <html> <head> </head> <FRAMESET cols=80%,20% border=5> <FRAME SRC="http://127.0.0.1:8080/cudl/modelSelector/StartCUDL.jsp" NAME="cudl"> <FRAME SRC="test.html" NAME="test"> </FRAMESET> </html> this is the "cudl" frame with all the jsp/javascript taken out for clarity: <html> <head> <script language="Javascript"> ...bunch of javascript to update the page... </script> </head> <body> <form name="myform" method="post" action="ModelSelectDebug.jsp"> ... </form> </body> </html> after the form submits here, this is where it's redirected (ModelSelectDebug): <html> <head> <script language="Javascript"> ...bunch of javascript to update the page... </script> </head> <frameset rows="100%,0%" frameborder=0 framespacing=0> <!--frame id="informationFrame" name="informationFrame" scrolling="no" target="contents" src="blank.html"--> <frame id="displayFrame" name="displayFrame" scrolling="yes" src="blank.html"> <frame id="dataFrame" name="dataFrame" scrolling="no" src="ModelSelectData.jsp<%=dataURLParameter%>"> </frameset> </html> That's where I try to go into displayFrame and end up in blank.html. This is part of the displayFrame: <%@ page import="com.chrome.cudlpsg.ChromeSessionHandler, com.chrome.cudlpsg.modelSelector.PagingHandler"%> <html> <script language="Javascript"> ...bunch of javascript to update the page... </script> </head> <body onLoad="Javascript:updatePage();" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" > <script language="Javascript"> document.write(...write the whole doc...) </body> </html> > 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 <elebeau@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 http://www.blackhat.com > _______________________________________________ > Htmlunit-user mailing list > Htmlunit-user@li... > https://lists.sourceforge.net/lists/listinfo/htmlunit-user > > |