有没有办法从 jmeter 运行 c# 程序?
Is there a way to run a c# program from jmeter?
我有一个我写的程序,它获取两个参数并设置一些要上传的文件,我想知道我是否可以在执行 HTTP 上传请求之前从 Jmeter 运行 它。
您可以使用 OS Process Sampler 调用 C# 程序的 .exe
文件。
您可以使用 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 执行任何程序。
相关代码会很简单:
"your_command".execute()
如果需要命令输出,可以修改为:
"your_command".execute().text
该方法适用于任何操作系统。请参阅 Groovy is the New Black 文章,了解 Groovy 还可以做什么。
我有一个我写的程序,它获取两个参数并设置一些要上传的文件,我想知道我是否可以在执行 HTTP 上传请求之前从 Jmeter 运行 它。
您可以使用 OS Process Sampler 调用 C# 程序的 .exe
文件。
您可以使用 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 执行任何程序。
相关代码会很简单:
"your_command".execute()
如果需要命令输出,可以修改为:
"your_command".execute().text
该方法适用于任何操作系统。请参阅 Groovy is the New Black 文章,了解 Groovy 还可以做什么。