JMeter:您的浏览器似乎禁用了JavaScript [英] JMeter: JavaScript seems to be disabled in your browser

查看:1524
本文介绍了JMeter:您的浏览器似乎禁用了JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行登录功能后,在树中查看结果"中的响应数据显示如下:

After executing Login feature, Response data in "View Results in Tree" shows following:

您的浏览器似乎禁用了JavaScript.您必须在浏览器中启用JavaScript才能使用该网站的功能.

注意:Firefox中的JavaScript已启用,并且我已使用测试脚本记录器"来记录浏览器会话.

Note: JavaScript in Firefox is enabled and I have used "Test Script Recorder" to record browser session.

我浏览了以下帖子,但到目前为止没有任何帮助: JMeter和JavaScript

I went through below posts but nothing helped so far: JMeter and JavaScript

推荐答案

来自 JMeter项目主页

JMeter不是浏览器.就网络服务和远程服务而言,JMeter看起来像一个浏览器(或者说多个浏览器).但是,JMeter不会执行浏览器支持的所有操作.特别是, JMeter不会执行在HTML页面中找到的Javascript .它也不会像浏览器那样呈现HTML页面(可以将响应查看为HTML等,但是计时未包含在任何示例中,并且一次只在一个线程中查看一个示例).

JMeter is not a browser. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever viewed at a time).

尽管JMeter无法执行JavaScript,但它能够记录关联的HTTP请求.

Although JMeter cannot execute JavaScript, it is capable of recording associated HTTP Requests.

在用JMeter模拟登录的情况下,可能是用JavaScript生成了一些动态令牌的情况,因此您需要从第一个响应源代码中提取它,并将其作为参数添加到第二个请求中,这样您的测试应该看起来像像:

In case of simulating a login with JMeter it might be the case when some dynamic token is being generated with JavaScript so you need to extract it from the 1st response source code and add as a parameter to 2nd request so your test should look like:

  1. 获取登录页面的请求
  1. GET request to login page
    • Extract any dynamic parameters (Regular Expression Extractor is mostly used for this)

请参见如何使用JMeter进行登录身份验证以获取详细的分步说明.

See How To Use JMeter For Login Authentication for detailed step-by-step instructions.

这篇关于JMeter:您的浏览器似乎禁用了JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆