jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas <>
Subject How to test sample succes to run or cancel next sample ?
Date Thu, 08 Dec 2005 15:40:39 GMT

I built a test case to test load on an intranet website of my company 
using JMeter.
The goal is to test load of the HTML GUI of the site, not database load 
or anything else.

I first explain below what I already tested and the problems I encountered.
Finally the question is on the end of this e-mail, I hope you'll get 

So I first test the user login to the site and then test the call of a 
page showing a list of products.

On this site, users have to be logged in to see the products listing page.
So I'd like to run the http sample that call the listing page only if 
the http sample that call the login page and tries to log in is successful.
A successful login is tested using a regular expression to look for a 
session id in the HTML resulting page.

I tried to add a Result Status Action Handler post-processor in my login 
http sample, but it stops the tread definitely on failure.
What I want is just a loop to be stopped and the thread have to continue 
in the next loop because login can fail due to heavy load or any other 
problem and well work on next loop. It's a shame to stop all the thread 
for that.

Another way I tried was to create an IF logic controller, but I don't 
know which variable value to test in this IF.
As I already had a Regular Expression Extractor to get a variable from 
the session ID returned by the login result page, I tried to use it for 
my test.
I added a "null" value in the default value field of the Regular 
Expression Extractor to have a value to test.
In my IF logic controller, I test if my variable is different to "null".

But this works because I have something to retrieve as I need the 
session ID in other samples.

My problem is that I also want to run other samples on a basis of 
preceding sample success, and this samples don't necessary need to 
retrieve any informations as the login sample do. I don't want to create 
extra test such as Regular Expression Extractor if I don't need to 
retrieve any informations. It would duplicate the assertions I already 
added to the samples and complicate the test case.

So I'd like to test if the preceding sample completed successfully 
before running any new sample without using Regular Expression Extractor.

One of my ideas is to use a JMeter variable, if such a variable exist.
So is there any JMeter variable, or anything else that would look like 
${isPrecedingSampleSuccessfull} for example to test if preceding sample 
in the same thread succeed ?

Did I miss something important in the JMeter usage ?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message