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:获取登录页面的请求提取任何动态参数(正则表达式提取器通常用于此)GET request to login pageExtract 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-27 01:55
查看更多