JMeter和JavaScript [英] JMeter and JavaScript

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

问题描述

当我在JMeter中发出HTTP请求时,我将获得响应数据,例如此页面使用JavaScript并需要启用JavaScript的浏览器."如何解决这个问题.

When I make HTTP Request in JMeter I get Response data like "This page uses JavaScript and requires a JavaScript enabled browser." How is it possible to fix this problem.

推荐答案

JMeter不是浏览器,也不解释下载页面中的JavaScript.

JMeter is not a browser, and does not interpret the JavaScript in downloaded pages.

JMeter Wiki :

JMeter不处理HTML页面中嵌入的Javascript或applet.

JMeter does not process Javascript or applets embedded in HTML pages.

JMeter可以下载相关资源(一些嵌入式资源 如果设置了正确的选项,则会自动下载),但是 不会处理HTML并执行任何Javascript函数.

JMeter can download the relevant resources (some embedded resources are downloaded automatically if the correct options are set), but it does not process the HTML and execute any Javascript functions.

如果页面使用Javascript来构建URL或提交表单,则您 可以使用Proxy Recording工具来创建必要的采样器. 如果无法做到这一点,则可能需要手动检查代码 需要确定JavaScript的功能.

If the page uses Javascript to build up a URL or submit a form, you can use the Proxy Recording facility to create the necessary sampler. If this is not possible, then manual inspection of the code may be needed to determine what the Javascript is doing.

根据您的工作,可以使用 Selenium IDE for Firefox创建执行测试.该测试将在您的浏览器中运行,因此JavaScript也将运行.请注意,尽管我从未使用Selenium替代JMeter,也不了解这两个工具的共同功能.

Depending on what you are doing, you could create an execution test using Selenium IDE for Firefox. The test will run in your browser so the JavaScript will also run. Note though that I never used Selenium as a substitute for JMeter and don't know about common features to both the tools.

这篇关于JMeter和JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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