On 24/05/2008, Fitzpatrick, Adrian <[EMAIL PROTECTED]> wrote: > > Hi, > > I have a large number of JMeter thread groups that step through 10 - 20 pages > in our application. I want to add a general assertion for our error page > (looking for the text "<title>Error</title>"), such that the sample is > flagged as a failure if the error page shows up when requesting any page. > Rather than adding this Error Page assertion to each page sample > individually, which would be time consuming (10-20 page samplers * 15 thread > groups) I want to group the pages using a Simple Controller and add the > Assertion to the controller. There would be one controller per thread group, > which cuts down the work and makes my test script more elegant. >
You could add the Assertion as a child of the Test Plan; it will then be applied to all samplers. > This works fine, except for one problem. The majority of my pages contain > images with JMeter is configured to download as embedded resources - we want > this behaviour so as to fully simulate the load on the system. The images are > cause a problem for my Error Page assertion - the assertion fails with this > message: > > Assertion error: false > Assertion failure: true > Assertion failure message : Response was null > > I think this is happening because it is trying to assert against the > image(s), but there is not response text for them. Am I right in thinking > this, and if so (or otherwise!) could anyone suggest any clever way of > getting around this? No, unless the image download fails, the response won't be null. It's very unlikely that the the text would match your error page string, so you would see something like: Assertion error: false Assertion failure: true Assertion failure message : Test failed: text not expected to contain /error/ instead. I've just done a test with JMeter 2.3.1 using "download embedded resources", and the Assertion is only applied to the parent sample. So it seems one of the primary samples is returning null. I suggest you use the Tree View Listener to examine the failing responses. The Java Request / JavaTest sampler can be used to generate null data - don't enter anything in the ResultData field. > Thanks very much in advance, > > Adrian > > ************************ > > This message has been delivered to the Internet by the Revenue Internet > e-mail service (OP) > > ************************* > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

