#64 Frames hidden using JS Code

closed
nobody
None
6
2007-12-30
2007-01-13
Lokesh
No

Hi

I am trying to write a program which involving accessing the admin page of my DSL router.

The admin page displays a navigation bar to the left which has links I want to click. However, when I access the main page using Httpunit, it returns a page with javascript code, which does the job of rendering the frames. Due to this, httpunit does not recognise that frames exist on that page, and I get an exception when i try to getFrameContents()

My code:
public static void main(String[] args) throws IOException, MalformedURLException, SAXException {
// TODO Auto-generated method stub
WebConversation wc = new WebConversation();
wc.setAuthorization("admin", "admin");
WebResponse wr = wc.getResponse("http://192.168.1.1");
System.out.println(wr.getText());
//WebResponse menuFrame = wc.getFrameContents("menufrm");
//System.out.println(menuFrame.getText());
}

The output is:
Rhino classes (js.jar) not found - Javascript disabled
<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<title>DSL Router</title>
<script language="javascript" src="my.js"></script>
<script language="javascript">
<!-- hide
var language = getlanguage('1');
document.writeln("<frameset rows='89,*,15' border='0' frameborder='0' framespacing='0'>");
document.writeln(" <frame src='logo_0.html' name='logofrm' frameborder='no' border='0' scrolling='no' target='_self' marginwidth='0' marginheight='0' noresize>");
document.writeln(" <frameset cols='170,*' frameborder='0' border='0'>");
document.writeln(" <frame src='menu_" + language + ".html' name='menufrm' frameborder='no' border='0' scrolling='no' target='_self' marginwidth='0' marginheight='0' noresize>");
document.writeln(" <frame src='info_" + language + ".html' name='basefrm_0' frameborder='no' border='0' scrolling='auto' target='_self' marginwidth='0' marginheight='16' noresize>");
document.writeln(" </frameset>");
document.writeln(" <frame src='footer_" + language + ".html' name='footerfrm' frameborder='no' border='0' scrolling='no' target='_self' marginwidth='0' marginheight='0' noresize>");
document.writeln("</frameset>");
// done hiding -->
</script>
</head>
</html>

Any ideas?

Discussion

  • Lokesh

    Lokesh - 2007-01-13
    • priority: 5 --> 6
     
  • Wolfgang Fahl

    Wolfgang Fahl - 2007-12-30

    Logged In: YES
    user_id=1220573
    Originator: NO

    Please send support requests to the mailing list

     
  • Wolfgang Fahl

    Wolfgang Fahl - 2007-12-30
    • status: open --> closed
     

Log in to post a comment.