On 27 January 2011 11:44, Adam Ploverall <adam.plover...@googlemail.com> wrote: > Hello > > I have been trying to build some conditional logic into my tests, and > have been trying the IF CONTROLLER, RESPONSE ASSERTION and BEAN SHELL > ASSERTIONs. Sometimes, my HTTP SAMPLER gets a timeout response like: > > java.net.SocketTimeoutException: connect timed out > > or > > java.net.SocketTimeoutException: Read timed out > > These might be due to lack of resources, or the tested site being > down. But it seems the HTTP SAMPLER is setting these: > > Error Count: 1 > Response code: Non HTTP response code: java.net.SocketTimeoutException > > and I can't work out how to suppress this, and say skip a subsequent > MAILER VISUALIZER. > > In a BEAN SHELL ASSERTION, I have tried: > > if (ResponseCode.equals(null)==false && ResponseCode.equals("Non > HTTP response code: java.net.SocketTimeoutException")==false) { > > ... > > } > > but the sampler seems to be skipped due to the HTTP SAMPLER error. If
Do you mean the assertion is skipped? Are you sure? Try adding a print("message") call to the start of BSH Assertion. Also print out the values of critical variables in the script. And check jmeter log file for script errors. > I use a RESPONSE ASSERTION, I can ignore the status code (checkbox), > but then have little control about what happens next. > > My aim is to do something like this: > > 1. Do an HTTP request > 1a) 5 min timer delay (Constant Timer) > > 2. If the response has a status code and content (else skip to 3.): > 2a) do some other response assertion tests on the headers and content > 2b) use the mailer visualiser to alert on any failure (0/0 setting) > 2c) Skip to 4. > > 3. If a java.net.SocketTimeoutException occurs > 3a) use the mailer visualiser to alert on two failures (1/0 setting) > 3b) reset the failure count to 0 if we haven't had another failure in X > minutes > 3c) Continue to 4 > > 4. Continue indefinite loop > > In other words, treat the 3s with less priority. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org > For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org