JaiK
JaiK

Reputation: 377

Jmeter : How to test a website to render a page regardless of the content

I have a requirement where the site only needs to respond to the user within certain seconds, regardless of the contents.

Now there is a option in Jmeter in HTTP Proxy Server -> URL Patterns to exclude and then to start recording.

Here I can specify gif, css or other content to ignore. However before starting the recording I have to be aware of what are the various contents that are going to be there.

Is there any specific parameter to pass to Jmeter or any other tool which takes care about loading the page only and I can assert the response code of that page and no the other contents of the page are recorded.

Thanks.

Upvotes: 0

Views: 5171

Answers (2)

Aliaksandr Belik
Aliaksandr Belik

Reputation: 12873

  1. Use the standard HTTP Request sampler with DISABLED (not checked) option Retrieve All Embedded Resources from HTML Files (set via sampler's control panel):

    "It also lets you control whether or not JMeter parses HTML files for images and other embedded resources and sends HTTP requests to retrieve them."

    NOTE: You may also define the same setting via HTTP Request Defaults.
    NOTE: See also "Response size calculation" in the same HTTP Request article.

  2. Add assertions to your http samplers:

    • Duration Assertion: to tests if response was received within a defined amount of time;
    • Response Assertion: to ensure that request was successfull,
      e.g.
      Response Field to Test = Response Code 
      Pattern Matching Rules = Equals
      Patterns to Test = 200
      

Upvotes: 2

Marko Bonaci
Marko Bonaci

Reputation: 5706

You want to run test that would ignore resources after certain number of seconds? I don't understand, what are you trying to accomplish by doing that? Users will still receive those resources when they request your url, so your tests wont be accurate.

I don't mean any disrespect, but is it possible that you misunderstood the requirements? I assume that the requirement is to load all the resources in certain number of seconds, not to cut off the ones that fail to fit in that time?

Upvotes: 0

Related Questions