qw88508850 发表于 2012-9-28 16:19:48

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

要在Jmeter里面通过beanshell执行wget来下载文件, 在本地用命令行wget可以正确下载文件wget http://www.sourcepole.com/assets/2011/1/4/BigFiles-Curl.jmx,但是在Jmeter的BeanShell里面用语句exec("wget 'http://www.sourcepole.com/assets/2011/1/4/BigFiles-Curl.jmx'")确没有任何反应, 在view result tree里面没有任何错误信息,Sampler Result是Thread Name: Thread-Gruppe 1-1
Sample Start: 2012-09-28 15:11:46 CST
Load time: 39
Latency: 0
Size in bytes: 0
Headers size in bytes: 0
Body size in bytes: 0
Sample Count: 1
Error Count: 0
Response code: 200
Response message: OK

Response headers:


SampleResult fields:
ContentType:
DataEncoding: null求帮忙看看怎么回事

qw88508850 发表于 2012-10-9 17:23:11

自己解决问题了, 把答案贴出来供大家参考String command = "cmd /c start wget.exe xxxxxxxx";
Runtime r = Runtime.getRuntime();
Process p2 = r.exec(command);

qw88508850 发表于 2012-10-9 17:23:19

自己解决问题了, 把答案贴出来供大家参考String command = "cmd /c start wget.exe xxxxxxxx";
Runtime r = Runtime.getRuntime();
Process p2 = r.exec(command);

qw88508850 发表于 2012-10-9 17:23:24

自己解决问题了, 把答案贴出来供大家参考String command = "cmd /c start wget.exe xxxxxxxx";
Runtime r = Runtime.getRuntime();
Process p2 = r.exec(command);

qw88508850 发表于 2012-10-9 17:23:25

自己解决问题了, 把答案贴出来供大家参考String command = "cmd /c start wget.exe xxxxxxxx";
Runtime r = Runtime.getRuntime();
Process p2 = r.exec(command);

qw88508850 发表于 2012-10-9 17:25:11

问题解决了,自己把答案发出来String command = "cmd /c start wget.exe xxxxxxxxxxxxxxx";
Runtime r = Runtime.getRuntime();
Process p2 = r.exec(command);
页: [1]
查看完整版本: 请教Jmeter里面BeanShell执行wget的问题