You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ryan Miling <rm...@bzzagent.com> on 2008/08/04 19:25:32 UTC

Form Template

I am interested in creating a test plan that will view a web page that
includes forms, obtain the form field names, establish random values for
the form fields, and submit the form. These forms, in particular, are
polls for users to fill out. They include radio(x) & checkbox(z)
matrices, radio(r) & checkbox(c) buttons, and required(treq) &
optional(topt) text boxes.

Currently my test plan includes extracting all of the field names, which
are stored into the vars:

x1,x2,x3,...
z1,z2,z3,... 
r1,r2,r3,... 
c1,c2,c3,... 
topt1,topt2,topt3,...
treq1,treq2,treq3,...

with random values obtained stores as:

x1Val,x2Val,x3Val,...
z1Val,z2Val,z3Val,... 
r1Val,r2Val,r3Val,... 
c1Val,c2Val,c3Val,... 
topt1Val,topt2Val,topt3Val,...
treq1Val,treq2Val,treq3Val,...

So when the HTTP request sampler submits the form, the parameters &
values are:

    ${x1} | ${x1Val}
     ...  |    ...
   ${x30} | ${x30Val}
    ${z1} | ${z1Val}
     ...  |    ...
   ${z30} | ${z30Val}
    ${r1} | ${r1Val}
     ...  |    ...
   ${r30} | ${r30Val}
    ${c1} | ${c1Val}
     ...  |    ...
   ${c30} | ${c30Val}
 ${topt1} | ${topt1Val}
     ...  |    ...
${topt30} | ${topt30Val}
 ${treq1} | ${teq1Val}
     ...  |    ...
${treq30} | ${teq1Val30}

With an arbitrary number of 30 fields whether or not some of the
variables are defined or not.

Anyhow this does not seem to work for me and it's possible it doesn't
because I am submitting data that does not even exist. (6x30=180vars)

Is there any way to resolve this problem so it works with an arbitrary
number (30) of vars or even so an n number of vars? (i.e. with an HTML
Link Parser?)

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


Re: Form Template

Posted by sebb <se...@gmail.com>.
On 04/08/2008, Ryan Miling <rm...@bzzagent.com> wrote:
> I am interested in creating a test plan that will view a web page that
>  includes forms, obtain the form field names, establish random values for
>  the form fields, and submit the form. These forms, in particular, are
>  polls for users to fill out. They include radio(x) & checkbox(z)
>  matrices, radio(r) & checkbox(c) buttons, and required(treq) &
>  optional(topt) text boxes.
>
>  Currently my test plan includes extracting all of the field names, which
>  are stored into the vars:
>
>  x1,x2,x3,...
>  z1,z2,z3,...
>  r1,r2,r3,...
>  c1,c2,c3,...
>  topt1,topt2,topt3,...
>  treq1,treq2,treq3,...
>
>  with random values obtained stores as:
>
>  x1Val,x2Val,x3Val,...
>  z1Val,z2Val,z3Val,...
>  r1Val,r2Val,r3Val,...
>  c1Val,c2Val,c3Val,...
>  topt1Val,topt2Val,topt3Val,...
>  treq1Val,treq2Val,treq3Val,...
>
>  So when the HTTP request sampler submits the form, the parameters &
>  values are:
>
>     ${x1} | ${x1Val}
>      ...  |    ...
>    ${x30} | ${x30Val}
>     ${z1} | ${z1Val}
>      ...  |    ...
>    ${z30} | ${z30Val}
>     ${r1} | ${r1Val}
>      ...  |    ...
>    ${r30} | ${r30Val}
>     ${c1} | ${c1Val}
>      ...  |    ...
>    ${c30} | ${c30Val}
>   ${topt1} | ${topt1Val}
>      ...  |    ...
>  ${topt30} | ${topt30Val}
>   ${treq1} | ${teq1Val}
>      ...  |    ...
>  ${treq30} | ${teq1Val30}
>
>  With an arbitrary number of 30 fields whether or not some of the
>  variables are defined or not.
>
>  Anyhow this does not seem to work for me and it's possible it doesn't
>  because I am submitting data that does not even exist. (6x30=180vars)
>  Is there any way to resolve this problem so it works with an arbitrary
>  number (30) of vars or even so an n number of vars? (i.e. with an HTML
>  Link Parser?)

Sorry for the long delay in replying.

If a variable name is defined as blank, then the parameter will be
ignore when creating the request data. However, if the variable name
is not defined, then the parameter will not be ignored.

So you need to make sure that all the variables for the parameter
names are defined, either with the proper name, or as an empty string
(in which case the corresponding value is not needed).

>
>  ---------------------------------------------------------------------
>  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