没有互联网的 VM 上的 jMeter 未完成测试

jMeter on VM with no internet not finishing test

我的公司正在尝试在没有互联网连接的 VM(Windows Server 2003 :( ) 中使用 JMeter 来访问另一个在 IIS 上设置了服务器和代码 运行 的 VM。我在我的主机文件中设置 ip 地址,我们现在称之为 server.dev。我们的目标是访问服务器。dev/doSomething 当我们进入 IE 并点击 server.dev 时,我们会得到响应。

我们将密钥库与 JMeter 一起使用,它说它可以正确创建它。在 JMeter 中,我们有一个 HTTP 请求,我们点击 server.dev,路径设置为 /doSomething。然后 JMeter 启动,日志没有错误,但是一旦显示 "Creating the HTTPS Trusall Scheme" 它就会挂起。当我在它上面放置调试标志时,它表明它正确地创建了 SOAP 请求并且似乎将其发送出去。 Headers 应该都是正确的。它在这里挂起大约 1 分钟,然后因说出 "Could not get response from server" 行的错误而关闭。

有人知道从这里到哪里去吗?我试着调试了几个小时,但一无所获。我似乎也无法加载 Fiddler 来查看网络流量,因为没有设置本地主机。

很可能是 IE 使用了代理而 JMeter 没有。尝试其他浏览器,即 Firefox(如果您在安装过程中不导入任何内容,它不会考虑系统代理设置)并且如果 Firefox 无法建立连接 - 我的假设是正确的,您是坐在代理服务器后面。

有一种方法 "tell" JMeter 使用代理服务器,它可以通过命令行参数控制,即:

-H [proxy server hostname or ip address]
-P [proxy server port]
-N [nonproxy hosts] (e.g. *.apache.org|localhost)
-u [username for proxy authentication - if required]
-a [password for proxy authentication - if required]

有关完整列表,请参阅 Using JMeter behind a proxy guide for details and Full list of command-line options

您还可以在 system.properties 文件(位于 JMeter 安装的 /bin 文件夹下)中配置代理设置,向其中添加以下行:

http.proxyHost=your.proxy.ip.address.or.host.name
http.proxyPort=your.proxy.port
https.proxyHost=your.proxy.ip.address.or.host.name
https.proxyPort=your.proxy.port

在 JMeter 重新启动后,一切都应该按预期工作。

有关 JMeter 属性以及设置和覆盖它们的方法的更多信息,请参阅 Apache JMeter Properties Customization Guide