jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Lin <wool...@gmail.com>
Subject Re: how to pass in username and password for load testing?
Date Mon, 15 Nov 2004 15:48:42 GMT
that means the login is form based.

basic authentication is when the browser pops-up a login prompt.

just add the request parameters to the sampler and it should work. to
verify, you can add a listener like view results in tree and see what
the server returns

peter


On Mon, 15 Nov 2004 10:30:50 -0500, Li, Charles
<charles.li@dep.state.fl.us> wrote:
> How can I tell?
> The login page has fields for me to enter username and password.
> 
> Thanks,
> Charles Li
> 
> This is the source of the page:
> 
> +++++++++++++++++++++++++++++++++++
> <html lang="en">
> <HEAD>
> <TITLE>OTN WebStore Login Page</TITLE>
> <LINK rel="stylesheet" href="includes/styles.css" type=
>     "text/css">
> 
> <!-- To prevent caching -->
> 
> <SCRIPT>
> function submitForm() {
>   var frm = document.login;
> 
>   // Check if all the required fields have been entered by the user before
>   // submitting the form
>   if( frm.j_username.value == "" ) {
>     alert("Please enter your Username");
>     frm.j_username.focus();
>     return ;
>   }
> 
>   if( frm.j_password.value == "" ) {
>     alert("Please enter your password");
>     frm.j_password.focus();
>     return ;
>   }
>   frm.submit();
> }
> </SCRIPT>
> </HEAD>
> <BODY>
> <FORM name="login" action="j_security_check" METHOD=POST>
>   <TABLE border="0" cellspacing="0" cellpadding="0" width=
>       "100%" valign="top">
>     <TR>
>        <TD><img src="images/vsmLogo.gif" border="0"></TD>
>   </TABLE>
>   <TABLE width="100%" border="0" cellspacing="0" cellpadding=
>       "1" bgcolor="white">
>     <TR bgcolor="#838357">
>       <TD align="left" width="76%"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A
href=
>           "main.do?login=true" class="WhiteText">Home</A></TD>
>     </TR>
>     <TR bgcolor="#DFDFBF">
>       <TD width="76%" class="BlueText">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Welcome
> to OTN WebStore </TD>    </TR>
> 
>   </TABLE>
> 
>   <TABLE width="100%" border="0" cellspacing="0" cellpadding=
>       "1" bgcolor="white">
>       <!--
>     <TR>
>       <TD align="right" class="SubHeading">Sign in with your username and
> password to continue </TD>
>     </TR>
>     -->
>     <TR>
>       <TD width="70%" valign="top">
>         <P>&nbsp;</P>
>         <BLOCKQUOTE>
>           <P class="BlueBold"> New to OTN WebStore ?</P>
>           <P class="BlackText"><A href=
>               "registration.do?command=displayForm" class="Link"> Sign Up
> Now</A> to enjoy unrivalled online shopping experience</P>
>         </BLOCKQUOTE>
>         <DIV style="margin-left: 4em">
>           <BLOCKQUOTE>
>             <P class="BlueText">At OTN WebStore you will find</P>
>           </BLOCKQUOTE>
>           <UL class="BlackText">
>             <LI>What you need. Fast.</LI>
>             <LI>Exceptional choice.</LI>
>             <LI>Great deals.</LI>
>           </UL>
>         </DIV>
>       </TD>
>       <TD width="30%" valign="top">
>         <TABLE width="100%" border="0" cellspacing="0"
>             cellpadding="1" bgcolor="#B3B18E">
>           <TR>
>             <TD align="top">
>               <TABLE width="100%" bgcolor="#F0F0E6" border="0"
>                   cellspacing="0" cellpadding="3" height="128">
>                 <TR>
>                   <TD>
>                     <CENTER>
>                       <B class="bluebold"><FONT size=
>                           "+1">Existing WebStore Users</FONT></B><BR>
>                       <FONT size="-1">Enter your username/ password
> here</FONT>
>                     </CENTER>
>                     <br>
>                     <TABLE width="100%" border="0" cellspacing=
>                         "0" cellpadding="5">
>                       <TR align="center">
>                         <TD align="right" class="Prompt"> User Name</TD>
>                         <TD align="left">
>                           <INPUT type="text"
>                             name="j_username" maxlength=20>
>                         </TD>
>                       </TR>
>                       <TR align="center">
>                         <TD align="right" class="Prompt"> Password</TD>
>                         <TD align="left">
>                           <INPUT type="password"
>                             name="j_password" maxlength=20 >
>                         </TD>
>                       </TR>
>                     </TABLE>
>                     <BR>
>                     <CENTER>
>                       <A HREF="javascript:submitForm()"><img
> src="images/buttons/signup.gif" border="0"></A>
>                       <br>
>                       <A
>                           href="notifypasswordform.do"
>                           class="HeaderLink">Forgot your password? Click here
> to proceed</A>
>                       <P><A
>                           href="changepasswordform.do"
>                           class="HeaderLink">Change your password? Click here
> to proceed</A></P>
>                     </CENTER>
>                   </TD>
>                 </TR>
>               </TABLE>
>             </TD>
>           </TR>
>         </TABLE>
>       </TD>
>     </TR>
>   </TABLE>
> </FORM>
> 
> <IMG src="images/line.gif" width="100%" height="12">
> <TABLE width="100%" border="0" cellspacing="0" cellpadding="1"
>     bgcolor="white">
>   <TR>
>     <TD align="left"><FONT face="Verdana, Arial, Helvetica, sans-serif"
>       size="-2">
>       Number of visitors:4</FONT> </TD>
>     <TD align="center"><FONT face="Verdana, Arial, Helvetica, sans-serif"
>       size="-2">
> 
>       <A href="guestbook.do" class="HeaderLink">Questions, Comments,
> Suggestions ? Let us know your views through guest book</A>.</FONT>
>     </TD>
>     <TD align="right" class="BlackSmall"><A href="terms.do"
> class="HeaderLink">
>     Terms of Use</A></TD>
>   </TR>
> </TABLE>
> <br>
> <b><FONT face="Verdana, Arial, Helvetica, sans-serif"
>       size="-2"> Powered by <font color="red" size="-2"><i>Oracle Application
> Server Containers for J2EE 10g (9.0.4.1.0)</i></font></font></b>
> 
> </BODY>
> </html>
> +++++++++++++++++++++++++++++++++++
> 
> -----Original Message-----
> From: Peter Lin [mailto:woolfel@gmail.com]
> Sent: Monday, November 15, 2004 10:27 AM
> To: JMeter Users List
> Subject: Re: how to pass in username and password for load testing?
> 
> is the authentication form based or http protcol based.
> 
> in other words.  is the username passed as request parameters, or
> basic authentication?
> 
> peter
> 
> On Mon, 15 Nov 2004 10:24:42 -0500, Li, Charles
> <charles.li@dep.state.fl.us> wrote:
> > I have a sample application that I want to use for load test with JMeter.
> > How do I pass in username and password to test pages that are protected by
> > authentication?
> >
> > In the source, I have the following:
> > ====================================
> >   if( frm.j_username.value == "" ) {
> >     alert("Please enter your Username");
> >     frm.j_username.focus();
> >     return ;
> >   }
> >
> >   if( frm.j_password.value == "" ) {
> >     alert("Please enter your password");
> >     frm.j_password.focus();
> >     return ;
> > ====================================
> >
> > I added the following parameter:
> > frm.j_username.value=electowner
> > frm.j_password.value=welcome
> >
> > But, first I want to test that it actually reads the username and password,
> > so I did this:
> >
> > I try it on the browser and it did not read the username and password.
> >
> (http://server:port/vsm/authownerhome.do?frm.j_username.value=electowner&frm.
> > j_password.value=welcome)
> >
> > How should I pass in the username and password?
> >
> > Thanks,
> > Charles Li
> 
> 
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message