简体   繁体   English

一旦通过Jmeter中的beanshall预处理器java脚本登录ssh主机,如何执行以下请求

[英]How to execute below requests once ssh host logged through beanshall pre processor java script in Jmeter

I have connected ssh host trough beanshall pre processor java script, after that I have to execute couple(around 20 test cases) of http sampler requests in that same host.我已经通过 beanhall 预处理器 java 脚本连接了 ssh 主机,之后我必须在同一主机中执行几个(大约 20 个测试用例)http 采样器请求。

Example: Connected ssh 10.12.38.231:12 username and password Logged above host using javascript Pre processor Next i want to copule of http sampler in same host.示例:已连接的ssh 10.12.38.231:12 用户名和密码使用 javascript 预处理器记录在主机上方接下来我想在同一主机中连接 http 采样器。

Am able to see logged into host in Jmeter console output But those request running in my local machine not in host.我能够在 Jmeter 控制台输出中看到登录到主机但是那些在我的本地机器上运行的请求而不是在主机中。

Is there any way to execute this scenario.有什么办法可以执行这个场景。

Thanks in advance!提前致谢!

If you want to connect to the remote machine over SSH and run the requests on that remote machine you have 2 options:如果您想通过 SSH 连接到远程机器并在该远程机器上运行请求您有两个选择:

  1. Transferring the JMeter test plan from the local machine to the remote one using ie SSH SFTP sampler使用 ie SSH SFTP 采样器将 JMeter 测试计划从本地机器传输到远程机器
  2. Installing JMeter onto that machine and kicking off the test in command-line non-GUI mode using SSH Command sampler将 JMeter 安装到该机器上并使用SSH 命令采样器在命令行非 GUI 模式下启动测试

Both samplers can be installed as a part of SSH Protocol Support bundle using JMeter Plugins Manager两个采样器都可以使用JMeter 插件管理器作为SSH Protocol Support包的一部分安装

在此处输入图片说明


Also forget about Beanshell, since JMeter 3.1 you should be using JSR223 Test Elements and Groovy language for scripting.也忘记 Beanshell, 因为 JMeter 3.1 你应该使用 JSR223 测试元素和 Groovy 语言编写脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM