Abhishek
Abhishek

Reputation: 11

Need to copy text file from one folder to another in windows using jmeter

My requirement is to copy text file from one folder to another in windows OS using jmeter. So how can we achieve this using jmeter?

Please help!

Thanks, Abhishek

Upvotes: 0

Views: 2126

Answers (2)

Dmitri T
Dmitri T

Reputation: 168157

You can do it in at least 2 ways:

  1. Using OS Process Sampler configured like:

    JMeter OS Process Sampler Copy File

  2. The faster (and cross-platform) way would be using JSR223 Sampler and the code like:

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

    See Groovy is the New Black for more information on using Groovy scripting in Jmeter tests.

Upvotes: 1

Ori Marko
Ori Marko

Reputation: 58862

Use OS Process Sampler and write your command in Command field

see Manual

Upvotes: 0

Related Questions