需要使用jmeter将文本文件从一个文件夹复制到另一个文件夹中

问题描述:

我的要求是使用jmeter将文本文件从一个文件夹复制到另一个文件夹。那么我们如何使用Jmeter来实现这一点呢?需要使用jmeter将文本文件从一个文件夹复制到另一个文件夹中

请帮忙!

感谢, 阿布舍克

使用OS过程采样和写入命令字段中输入命令

看到Manual

可以在至少2种方式做到这一点:

  1. 使用OS Process Sampler配置为:

    JMeter OS Process Sampler Copy File

  2. 的更快(跨平台)的方式将使用JSR223 Sampler和喜欢的代码:

    def sourceFile = new File('c:/somefolder/source_file.txt') 
    def destinationFile = new File('c:/someotherfolder/destination_file.txt') 
    destinationFile << sourceFile.text 
    

    对在测试中的JMeter使用Groovy脚本的更多信息,请参阅Groovy is the New Black