Limbo
Limbo

Reputation: 663

Is there a way to run a c# program from jmeter?

I have a program I wrote that gets two parameters and set some files to be upload, and I want to know if I can run it from Jmeter before performing the HTTP upload requests.

Upvotes: 4

Views: 810

Answers (2)

Dmitri T
Dmitri T

Reputation: 168072

You can execute any program using JSR223 Sampler and Groovy language. If you don't want this execution to appear in the .jtl results file you can use i.e. JSR223 PreProcessor instead.

The relevant code will be as simple as:

 "your_command".execute() 

If you need the command output, you can amend it as:

"your_command".execute().text 

The approach works on any operating system. See Groovy is the New Black article to learn what else could be done with Groovy.

Upvotes: 0

Amr Eladawy
Amr Eladawy

Reputation: 4358

You can use OS Process Sampler to invoke the .exe file of your C# program.

enter image description here

Upvotes: 4

Related Questions