51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 3538|回复: 5
打印 上一主题 下一主题

请教Jmeter里面BeanShell执行wget的问题

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2012-9-28 16:19:48 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
要在Jmeter里面通过beanshell执行wget来下载文件, 在本地用命令行wget可以正确下载文件
  1. wget http://www.sourcepole.com/assets/2011/1/4/BigFiles-Curl.jmx
复制代码
,但是在Jmeter的BeanShell里面用语句
  1. exec("wget 'http://www.sourcepole.com/assets/2011/1/4/BigFiles-Curl.jmx'")
复制代码
确没有任何反应, 在view result tree里面没有任何错误信息,Sampler Result是
  1. Thread Name: Thread-Gruppe 1-1
  2. Sample Start: 2012-09-28 15:11:46 CST
  3. Load time: 39
  4. Latency: 0
  5. Size in bytes: 0
  6. Headers size in bytes: 0
  7. Body size in bytes: 0
  8. Sample Count: 1
  9. Error Count: 0
  10. Response code: 200
  11. Response message: OK

  12. Response headers:


  13. SampleResult fields:
  14. ContentType:
  15. DataEncoding: null
复制代码
求帮忙看看怎么回事
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2012-10-9 17:23:11 | 只看该作者
自己解决问题了, 把答案贴出来供大家参考
  1. String command = "cmd /c start wget.exe xxxxxxxx";
  2. Runtime r = Runtime.getRuntime();
  3. Process p2 = r.exec(command);
复制代码
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2012-10-9 17:23:19 | 只看该作者
自己解决问题了, 把答案贴出来供大家参考
  1. String command = "cmd /c start wget.exe xxxxxxxx";
  2. Runtime r = Runtime.getRuntime();
  3. Process p2 = r.exec(command);
复制代码
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2012-10-9 17:23:24 | 只看该作者
自己解决问题了, 把答案贴出来供大家参考
  1. String command = "cmd /c start wget.exe xxxxxxxx";
  2. Runtime r = Runtime.getRuntime();
  3. Process p2 = r.exec(command);
复制代码
回复 支持 反对

使用道具 举报

该用户从未签到

5#
 楼主| 发表于 2012-10-9 17:23:25 | 只看该作者
自己解决问题了, 把答案贴出来供大家参考
  1. String command = "cmd /c start wget.exe xxxxxxxx";
  2. Runtime r = Runtime.getRuntime();
  3. Process p2 = r.exec(command);
复制代码
回复 支持 反对

使用道具 举报

该用户从未签到

6#
 楼主| 发表于 2012-10-9 17:25:11 | 只看该作者
问题解决了,自己把答案发出来
  1. String command = "cmd /c start wget.exe xxxxxxxxxxxxxxx";
  2. Runtime r = Runtime.getRuntime();
  3. Process p2 = r.exec(command);
复制代码
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-25 06:04 , Processed in 0.071688 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表