简体   繁体   English

我如何在本地Windows机器上的Jenkins中执行我的jmeter测试计划?

[英]how do I get my jmeter test plan to execute in Jenkins on my local windows machine?

I'm trying to get My jmeter test plan to execute in Jenkins. 我正在尝试让我的jmeter测试计划在Jenkins中执行。 Both jmeter and Jenkins are installed on my local windows machine. jmeter和Jenkins都安装在我的本地Windows计算机上。 I've set up some properties in Jmeter and verified that I can run them from the cmd line successfully with this command: 我已经在Jmeter中设置了一些属性,并验证可以使用以下命令从cmd行成功运行它们:

C:\\Users\\MikeL\\Documents\\apache-jmeter\\bin>jmeter -n -t testApp.jmx -l log.jtl -Jenv=dev -JloopCount=2

Now in Jenkins I've created a new project, create two new parameters and entered the following in "execute shell" based off of exapmples I was able to find on the web.I haven't configured anything else in Jenkins. 现在,在Jenkins中,我创建了一个新项目,创建了两个新参数,并根据我在网络上可以找到的示例在“ execute shell”中输入了以下内容。我在Jenkins中未进行任何其他配置。

sh jmeter.sh -n -p user.properties -t C:/Users/MikeL/Documents/apache-jmeter/bin/testApp.jmx -l log.jtl -Jenv=dev -JloopCount=1

suffice to say this script won't build my jmeter test. 足以说这个脚本不会建立我的jmeter测试。 I recieve this error: 我收到此错误:

Cannot run program "sh" (in directory "C:\\Program Files (x86)\\Jenkins\\workspace\\LOS API Regression Tests"): CreateProcess error=2, The system cannot find the file specified

If anybody has any clues I'd be very grateful! 如果有人有任何线索,我将不胜感激!

Add this path C:\\Users\\MikeL\\Documents\\apache-jmeter\\bin to your Environment Variables PATH . 将此路径C:\\Users\\MikeL\\Documents\\apache-jmeter\\bin到您的环境变量PATH

Then Jenkins Build step should be Windows Batch Command 然后,Jenkins Build步骤应为Windows Batch Command

Then the command should be jmeter -n -t testApp.jmx -l log.jtl -Jenv=dev -JloopCount=1 然后,该命令应为jmeter -n -t testApp.jmx -l log.jtl -Jenv=dev -JloopCount=1

Update: If you do not want to set the path, just directly give below command as Windows Batch Command. 更新:如果您不想设置路径,只需直接将以下命令作为Windows Batch Command即可。

C:\\Users\\MikeL\\Documents\\apache-jmeter\\bin\\jmeter.bat -n -t C:\\Users\\MikeL\\Documents\\apache-jmeter\\bin\\testApp.jmx -l log.jtl -Jenv=dev -JloopCount=1


Use either Ant/Maven/Gradle to run jmeter tests in the non-gui mode. 使用Ant / Maven / Gradle在非gui模式下运行jmeter测试。 They can also be integrated with Jenkins 它们也可以与Jenkins集成

The problem here is cross environment. 这里的问题是跨环境。 you need to be running this with windows batch command instead of execute shell. 您需要使用Windows批处理命令而不是执行Shell来运行它。 windows wont recognize sh as executable. Windows不会将sh识别为可执行文件。

C:\Users\MikeL\Documents\apache-jmeter\bin>jmeter -n -t testApp.jmx -l log.jtl -Jenv=dev -JloopCount=2

Run the above in execute windows batch mode 在执行Windows批处理模式下运行以上命令

Windows批处理模式

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从本地计算机上的远程主机上特定(但可变)目录中执行脚本? - How can I execute a script from my local machine in a specific (but variable) directory on a remote host? 如何在詹金斯的Windows从属计算机中执行Shell命令? - How to execute shell commands in windows slave machine from Jenkins? 如何在Windows PC上从PhpStorm在我的Vagrant上执行bash脚本 - How do I execute a bash script on my Vagrant from PhpStorm on a Windows PC 如何从Mac OS上的终端获取到计算机的远程登录IP? - How do I get remote login IP to my machine from terminal on Mac OS? 如何从本地计算机上的单个ssh命令在aws计算机上运行tmux命令? - How can I run tmux commands on an aws machine from a single ssh command on my local machine? 如何使postgresql在我的本地环境中工作? 我想构建并部署到heroku。 - How do I get postgresql to work in my local environment? I want to build and deploy to heroku. 如何获取有关我的 git 本地存储库的每个分支的信息 - How do I get the information about each branch of my git local repository Jenkins-在具有本地env变量的不同机器上执行脚本 - Jenkins - execute script on different machine with local env variables 如何与另一个用户ssh到另一台机器来执行脚本 - How to do I ssh to another machine with another user to execute a script 如何在我的机器上没有重复的自定义 bash 脚本目录并将其添加为使用 PATH 获取的链接? - How do I not have a duplicated custom bash script directory on my machine and add it as a link that is picked up with PATH?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM