edwardt_tril has asked for the wisdom of the Perl Monks concerning the following question:
#!perl use strict; use Test::More tests => 3; use Test::WWW::Mechanize; my $agent = Test::WWW::Mechanize->new; $agent->get_ok( 'http://192.168.44.132/reporter' ); $agent->field( 'Username:', 'admin' ); $agent->field( 'Password:', 'password' ); $agent->submit_form( form_name => 'f' ); $agent->follow_link_ok( { text => 'Home', n => '1' } ); $agent->field( 'query', 'test' ); $agent->submit_form( form_name => 'f' ); $agent->follow_link_ok( { text => 'Next >>', n => '1' } );
<script language="javascript"> function CreateI18n() { this.MUST_BE_NUMERIC="Input must be numeric and greater than ze +ro"; this.CANT_EXCLUDE="You cannot exclude a wildcard"; this.FROM="From"; this.TO="To"; this.ADVANCED_OPTIONS="Advanced Settings"; this.QUICK_OPTIONS="Basic Settings"; this.THIS_WILL_PERMANENTLY_DELETE1="This will permanently delet +e the selected entries"; this.DELETE_ALL_ENTRIES="Delete all entries in current view.\n* +** Warning! This action cannot be undone.***"; this.YOU_MUST_ENTER_USER_NAME_TO_CHANGE_PASSWORD="You must ente +r your user name and password in order to change your password"; this.ENTER_FILTER_NAME="Please enter a filter name into the fil +ter name field"; this.TO_DATE_MUST_BE_MORE_RECENT="The to date must be more rece +nt than the from date"; this.YOU_ENTERED_AN_INVALID_DATE_SEPARATOR="You entered an inva +lid date separator. It must be a single character and cannot be a spa +ce, ?, % or $."; this.YOU_MUST_ENTER_AN_ALERT_CONDITION="You must enter an alert + condition"; return this; } var I18n = CreateI18n(); </script> <html> <head> <title>Reporter - Login</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="../Resources/styles.css" rel="stylesheet" type="text/css"> </head> <body onload="document.PasswordForm.user_name_tmp.focus();" class="co +lor_link" leftmargin="0" marginheight="0" marginwidth="0" topmargin=" +0"> <!-- Menu Header --> <!-- Menu Header --> <script type="text/javascript" src="../Resources/sha1.js"></script> <script type="text/javascript" > function change_password() { hidden = document.getElementById('change_pwd'); hidden.value='on'; user_name_tmp = document.getElementById('user_name_tmp'); if (user_name_tmp.value == '') { alert('' + I18n.YOU_MUST_ENTER_USER_NAME_TO_CHANGE_PASSWORD); user_name_tmp.focus(); } else { document.PasswordForm.submit(); } } function login() { document.PasswordForm.submit(); } function sha1_password() { password_tmp_widget = document.getElementById('password_tmp_widget +'); password_tmp = document.getElementById('password_tmp'); var foo = "7cbc76df106c18e2363c552a71b6e455"; var total = hex_sha1(password_tmp_widget.value)+foo; var x = hex_sha1(total); //if (x != password_tmp.value) { password_tmp.value= x; //} } </script> <BR> <BR> <BR> <BR> <table width=600 align=center border="0" cellspacing="0" cellpadding +="0"> <tr> <td> <table border="0" align=center cellspacing="0" cellpadding="0"> <form method="post" name="PasswordForm" action="Login_veri +fy.php"> <tr width=100% height=60 valign=center > <table width=100% border=0 background="../images/loginT +itle.jpg"> <tr > <td height=60 class="HeaderPassword" colspan=2 ali +gn=center background="../images/loginTitle.jpg"> Login </td> <td height=60 > <img src="../images/loginlogoBlue.gif" alt="Login + logo" valign=top align="right" border="0"> </td> </tr> </table> </tr> <tr > <td > <table background="../images/gradient.png" width +=600 height=260 cellspacing="0" cellpadding="0" align="right"> <tr height=50 > <td align=left> </td> </tr> <tr height=70> <td> <table border=0 cellpadding=0 cellspacing +=0> <tr> <td></td> <td colspan=2> <span class=Menue>Please enter your user + name and password to login to Reporting:</span> </td> </tr> <tr> <td> </td> </tr> <tr> <td width=20%></td> <td width=20%> <table height=120 border=0 cellspacin +g=0 align=center cellpadding=5> <tr> <td align=left > <span class="Menue">User Name:</sp +an> </td> </tr> <tr> <td align=left > <span class="Menue">Password:</spa +n> </td> </tr> <tr> <td > <input type="hidden" name="destinat +ion" value="../dashboard/homepage.php"> <input type="hidden" name="referer" + value="../dashboard/homepage.php"> <input type="hidden" name="change_p +wd" id="change_pwd"> </td> </tr> </table> </td> <td width=40%> <table width=100% height=120 border +="0" cellspacing="0" cellpadding="5" align="left"> <tr> <td align=right> <input type="text" name="user_ +name_tmp" id="user_name_tmp" style="width: 225px"> </td> </tr> <tr> <input type="hidden" name="passwo +rd_tmp" id="password_tmp"> <td align=right> <input type="password" onChange +="sha1_password();" onMousemove="sha1_password();" id="password_tmp_w +idget" name="password_tmp_widget" style="width: 225px"> </td> </tr> <tr> <td align=right> <input type="submit" class="UCD" on +click="login();" value=' Login '</input> </td> </tr> </table> </td> <td width=20%></td> </tr> </table> </tr> <tr height=50><td></td></tr> <tr> <td width=600 height=5 colspan=3 bgcolor="FF +CC00"></td> </tr> </table> </td> </tr> </form> </table> <p> </p> </td> </tr> </table> </body> </html>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: testing website with login
by jonadab (Parson) on Dec 04, 2005 at 19:07 UTC | |
|
Re: testing website with login
by planetscape (Chancellor) on Dec 05, 2005 at 06:25 UTC | |
by hesco (Deacon) on Mar 12, 2006 at 20:45 UTC |