jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: "ForEach Controller" and "HTTP Request Defaults" do not interact correctly
Date Wed, 19 Nov 2008 11:47:24 GMT
On 19/11/2008, Ondrej Baudys <obaudys@gmail.com> wrote:
> Hello List,
>
>  I have stumbled upon what time me is definitely a bug in Jmeter. I was
>  able to reproduce the problem in Jmeter 2.3.1, 2.3, and 2.2
>
>  Consider the following test plan configuration:
>
>  Test Plan
>   Thread Group
>     User Defined Variables
>     ForEach Controller
>       HTTP Request Defaults
>       HTTP Request #1
>       HTTP Request #2
>     View Results Tree (Listener)
>
>
>  Where the user defined variables are:
>    SITE_1 = web-server
>    SITE_2 = dev-server
>    SITE_3 = localbox
>
>  and the ForEach Controller takes 'SITE' as input spits out 'siteName' as output
>
>  The "Server Name or IP" field of the "HTTP Request defaults" set to
>  ${siteName}.localdomain
>
>  I also use ${siteName} in the Path Field of the "HTTP Requests"
>    1. ${siteName}/index.html
>    2. ${siteName}/main.jsp
>
>
>  This is what I expect to see in the Request tab of the "View Results Tree":
>
>    1. GET http://dev-server.localdomain/dev-server/index.html
>    2. GET http://dev-server.localdomain/dev-server/main.jsp
>    3. GET http://web-server.localdomain/web-server/index.html
>    4. GET http://web-server.localdomain/web-server/main.jsp
>    5. GET http://localbox.localdomain/localbox/index.html
>    6. GET http://localbox.localdomain/localbox/main.jsp
>
>  ie. each pair of above requests has the output variable ${siteName}
>  populated as expected.
>
>  What actually happens:  requests 3. and 5. above are instead
>
>    3. GET http://dev-server.localdomain/web-server/index.html
>    5. GET http://web-server.localdomain/localbox/index.html
>
>  Ie. the 'siteName' variable as used in HTTP Restquest Defaults' server
>  name field is populated with the *previous iterations value* for the
>  *first http request only*.
>
>  Obviously everything works in the first step since there is no
>  previous iteration, any subsequent HTTP Requests are fine (only 2
>  requests above but I have tested with varing numbers).  The problem
>  always occurs on the first HTTP request.
>
>  I have tested with the java HTTP request and the apache commons
>  implementation. Same results.
>
>  I also added a test parameter on the HTTP Request Defaults: it works
>  fine both with and without the variable in the Server Name field.  So
>  I think the problem is with the Server Name field only.
>
>  I am attaching my example test plan (hopefully the mailing list lets
>  it through) so that you can reproduce the problem quickly.

Please don't send attachments to the list.

>  I have
>  looked through bugzilla for anything similar but I must admit I don't
>  know how to use it properly...  if someone can reproduce the problem
>  and/or cannot find a problem with my configuration, I will try and
>  open a bug report.
>

This is not a bug.

HTTP Request Defaults is a Configuration item; they are processed at
the start of their scope only. They are not processed at run-time like
samplers or Pre- or Post-Processors.

There is no need for the Request Defaults in this case - just use the
variable on the samplers.

>  Regards,
>
> Ondrej
>
>
> ---------------------------------------------------------------------
>  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