Menu

Problem with nested frames

Anonymous
2003-03-27
2003-03-28
  • Anonymous

    Anonymous - 2003-03-27

    I have been having problems with nested frames, especially if a component's target is the ancester frame.

    I have produced anexample
      
    WebConversation wc = new WebConversation();
    WebResponse r = wc.getResponse("http://localhost/Frames.html");
        r = wc.getFrameContents("title:menu");
        WebForm l[] = r.getForms();
        l[0].submit();

    Where Frames.html

    <HTML>
        <HEAD>
            <TITLE> A Nested Frameset </TITLE>
        </HEAD>
        <FRAMESET COLS="50,*">
            <FRAME SRC="left.html" name="left">
            <FRAMESET COLS="30,*">
                <FRAME SRC="title.html" name="title">
                <FRAME SRC="body.html" name="body">
                </FRAMESET>
            </FRAMESET>
    </HTML>

    Where title.html

    <HTML>
        <HEAD>
            <TITLE> A Nested Frameset </TITLE>
        </HEAD>
        <FRAMESET COLS="50,*">
            <FRAME SRC="menu.html" name="menu">
        </FRAMESET>");
    </HTML>

    Where menu (as below) contains a form which targets title (menu's parent)
    <html>
        <title>menu</title>
        <form name="deliveryForm" method="post" action="deliveryformmain.cmd" onsubmit="return false;" target="title"><input type="hidden" name="sfid" value="peop" /><input type="hidden" name="sid" value="9" /><input type="hidden" name="ds"></input><input type="hidden" name="rs"></input><input type="hidden" name="vids"></input><input type="hidden" name="dids"></input><input type="hidden" name="nxt"></input><td align="left" class="boldIt">FISH</form>
    </html>

    I get the following  exception
    com.meterware.httpunit.NoSuchFrameException: No frame named title:title is currently active

     
    • Russell Gold

      Russell Gold - 2003-03-27

      I cannot duplicate this problem. Are you using the latest version of HttpUnit? Please try the latest prerelease at <http://www.httpunit.org/prerelease>.

      One thing that looks odd: your example has:

      onSubmit="return false" - which should prevent the form from actually being submitted.

       
    • Anonymous

      Anonymous - 2003-03-28

      The actual code this is taken from does a bit more than this setting values etc. then submitting the values via javascript. The issue is that for this example and others I have is that when I go to a particular frame and then try to click on a link or  button etc. It appears to be appending the current frame I'm focused on to the target frame. I'll try the latest version.

       
    • Anonymous

      Anonymous - 2003-03-28

      The latest version fixed this problem but in the actual application what I'm getting is that the link I'm trying to click on calls some javascript that loops through the frames and builds up some urls. Below is an example of the exception. The link I'm clicking on is in the nested frame lower:main:common but clicking on the link which calls some javascript blows up saying that lower:main:lower:main:common is not active. Could the javascript be causing the problem?

           [java] java.lang.RuntimeException: URL 'javascript:top.getDelivery(document.deliveryForm, 'save');' failed: com.met
      erware.httpunit.NoSuchFrameException: No frame named lower:main:lower:main:common is currently active
           [java]     at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:1
      82)
           [java]     at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.getURLContents(JavaScript.java:173)
           [java]     at com.meterware.httpunit.scripting.ScriptableDelegate.evaluateURL(ScriptableDelegate.java:64)
           [java]     at com.meterware.httpunit.WebWindow.getResource(WebWindow.java:157)
           [java]     at com.meterware.httpunit.WebWindow.getSubframeResponse(WebWindow.java:117)

       
      • Russell Gold

        Russell Gold - 2003-03-28

        Could you please send or post a small but complete example that demonstrates the problem?  I need one that I can run myself.

         

Log in to post a comment.

Auth0 Logo