Jmeter:如何测试网站呈现页面(无论内容如何)

发布于 2024-12-19 23:03:16 字数 241 浏览 6 评论 0原文

我有一个要求,网站只需要在特定秒内响应用户,无论内容如何。

现在Jmeter中HTTP代理服务器中有一个选项->要排除的 URL 模式,然后开始记录。

这里我可以指定gif、css或者其他要忽略的内容。然而,在开始录制之前,我必须了解将要录制的各种内容是什么。

是否有任何特定参数传递给 Jmeter 或任何其他只负责加载页面的工具,我可以断言该页面的响应代码,并且不会记录页面的其他内容。

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冰雪之触 2024-12-26 23:03:16
  1. 使用带有 DISABLED(未选中)选项的标准 HTTP 请求 采样器 < strong>从 HTML 文件中检索所有嵌入资源(通过采样器的控制面板设置):

    <块引用>

    “它还可以让您控制 JMeter 是否解析 HTML 文件
    图像和其他嵌入资源并向
    找回它们。”

    注意:您还可以通过HTTP 请求默认值定义相同的设置。
    注意:另请参阅同一篇HTTP 请求文章中的“响应大小计算”。< /p>

  2. 将断言添加到您的 http 采样器:

    • 持续时间断言:测试是否在定义的时间内收到响应时间;
    • 响应断言:确保请求成功,
      例如

      要测试的响应字段 = 响应代码 
      模式匹配规则 = 等于
      要测试的模式 = 200
      
  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
      
梦里人 2024-12-26 23:03:16

您想运行在一定秒数后忽略资源的测试吗?
我不明白,你这样做到底想达到什么目的?
用户在请求您的网址时仍然会收到这些资源,因此您的测试不会准确。

我没有任何不尊重的意思,但是您是否可能误解了要求?
我假设要求是在一定秒数内加载所有资源,而不是切断在该时间内无法容纳的资源?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文