Try this :

public void setUp() {
  getTestContext().setBaseUrl("http://iiiiiiii:8042/insight/main/";);
    }
      public void testLogin() throws FileNotFoundException, 
UnsupportedEncodingException {
beginAt("login.jsp?username=user&password=pass&locale=US&Submit2=Login"); 
//Same as 
beginAt("http://iiiiiiii:8042/insight/main/login.jsp?username=user&password=pass&locale=US&Submit2=Login";);

  setScriptingEnabled(false);
  gotoPage("process/add-user"); //Same as 
gotoPage("http://iiiiiiii:8042/insight/main/process/add-user";);

    log=new PrintStream(new FileOutputStream("adduser.txt"),true,"UTF-8");
  dumpHtml(log);
  log.close();
    }

setBaseUrl do not browse to the given URL. It's only a convenient method to 
avoid typing application context path in each beginAt or gotoPage.

Hope it helps.

++

Julien

----- Message d'origine ----
De : Krishnapriya Gelli <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Lundi, 11 Décembre 2006, 19h18mn 46s
Objet : [Jwebunit-users] How to access menu items generated by javascript

Hello, 
  
 
  I have a page that has two frames and the menu is generated by 
javascript. I need to access a child element in the menu. Can somebody help me 
looking at the below code?
   
  after I log in I need to click on the menu item to add a user. The html 
of the page after login is: 

  <HTML><HEAD><TITLE> App Name</TITLE></HEAD> 
<FRAMESET ROWS="70, *" FRAMESPACING="0"> 
<FRAME SRC="/insight/main/share/menu.jsp"    NAME="menuframe" 
MARGINWIDTH=0 MARGINHEIGHT=0 NORESIZE scrolling="no"> 
<FRAME SRC="/insight/main/upload/upload-data-frame.jsp" 
NAME="bottomframe" MARGINWIDTH=0 MARGINHEIGHT=0 > --> 
</FRAMESET> 
</HTML> 

   
  
 
  Html in menuframe to access add user menu: 
  
 
  <TR bgcolor="#808080"> 
<TD
 colspan="2" height="20"> 
              <script language="JScript" 
src="/insight/share/javascript/menuwrite.js"></script> 
<PARAM NAME="Link5" VALUE="User Administration^"><PARAM NAME="Link50" 
VALUE="Add 
User^javascript:parent.frames['bottomframe'].location.href='/insight/main/p­rocess/add-user'"><PARAM
 
NAME="Link51" VALUE="List 
User^javascript:parent.frames['bottomframe'].location.href='/insight/main/p­rocess/user-list'"><PARAM
 
NAME="Link52" VALUE="Add 
Group^javascript:parent.frames['bottomframe'].location.href='/insight/main/­add-group.jsp'"><PARAM
 
NAME="Link53" VALUE="List 
Group^javascript:parent.frames['bottomframe'].location.href='/insight/main/­process/display-all-group'"><PARAM
 
NAME="Link54" VALUE="List
 
Resource^javascript:parent.frames['bottomframe'].location.href='/insight/ma­in/process/display-all-resources'"><PARAM
 
NAME="Link55" VALUE="Change 
Password^javascript:parent.frames['bottomframe'].location.href='/insight/ma­in/change-password.jsp'"></APPLET></TD>
 
</TR> 
   
  The code I am trying to use:
   
  public void setUp() {
  
getTestContext().setBaseUrl("http://iiiiiiii:8042/insight/main/login.jsp?username=user&password=pass&locale=US&Submit2=Login";);
  
  }
  
  
  public void testLogin() throws FileNotFoundException, 
UnsupportedEncodingException {
  setScriptingEnabled(false);
  beginAt("/insight/main/process/add-user");
  
  log=new PrintStream(new FileOutputStream("adduser.txt"),true,"UTF-8");
  dumpHtml(log);
  log.close();
  
  }
   
   
   
  Problem:
   
  The adduser.txt has the HTML code for the login page and not the add-user 
page.
   
  Thank you in advance.
   
  Priya

 



Everyone is raving about the all-new Yahoo! Mail beta.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users







        

        
                
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to