From: Umesh K. <uku...@di...> - 2003-07-07 03:19:28
|
Hi all, I am new to htmlunit and need your help in understanding how to write test case to generate submit event on a javascript menu item. Here is my code snippet.I am including only required part of code here for brevity.If anyone is interested in looking at complete code I am more than happy to send it. mainpage.html ------------- ..... ...... <script language="javascript1.2" src=/common/js/menus2.js type='text/javascript'></script> ..... ...... This main page imports javascript menus2.js. menus2.js ------------- ..... ..... document.write("<SCR" + "IPT LANGUAGE='JavaScript' SRC='/common/jsp/arrays.jsp' TYPE='text/javascript'><\/SCR" + "IPT>"); ..... ..... This javascript along with other checks imports arrays.jsp file which has required menus in dthml.We use hiermenus for displaying menus. arrays.jsp --------- ............ ............ // This menu represents top level menu HM_Array1 = [[200,0,<%=vertOffset%>,"<%=fontColor%>","<%=MOFontColor%>", "<%=BGColor%>","<%=MOBGColor%>","<%=MOBGColor%>","<%=MOBGColor%>",1,1,0,1,1, 1,"n ull","null",,,true,true,] // Display "Student Activities" in the top-level menu ,[" Student Activities ",,0,0,1] // Display "Manage Users" in the top-level menu ,[" Manage Users ",,0,0,1]] // Build "Student Activities" sub-menu structure HM_Array1_1 = [[] // Display "View Learning Center" ,[" View Learning Center ","/lms/LockerServlet?COMMAND=GetLocker&resetHistory=true",1,0,0 ]] ............ ............ The menus have top level menu with items like "Student Activities" & "Manage Users".These top level menus have sub-menus."Student Activities" menu item has sub-menu "View Learning Center". When you click on "Student Activities" sub-menus are displayed and clicking on sub-menus submits a click event and displays next page. I am trying to test this case need to know how to proceed with this.And kind of help is welcome. Thanks, Umesh |