I am using Jenkins and Ant to execute my Selenium tests. I would like to make a job that would do the following:
starts Selenium server
executes tests and
kills Selenium server after all tests are run.
I am able to start the Selenium server manually with the following command:
java -jar selenium-2.16.1\selenium-server-standalone-2.25.jar
But I cannot find a Jenkins plugin that would do the start/stop for me. All I can find are some Selenium reporting plugins.
Not sure if there is a plugin, but you can just run the launch and kill commands via the Jenkins job.
Under Build, if you add an Execute shell build step, you can run your commands from there.
Note - The path to the selenium server is relative to the current work directory.
Looking at your error trace, looks like you are running this on a windows PC. you need to be running this as a "execute windows batch command" then run java -jar selenium-2.16.1\selenium-server-standalone-2.25.jar Assuming that you have your jar file on the workspace. or you beed to point it at the right path
Related
I am running some performance tests from Jenkins. I do have two Windows machines with JMeter and I can configure from Jenkins which one to use. Everything works as expected here.
My issue: I did create another job for Stop/Shutdown the tests in case something goes wrong and you have a big run time. Whenever I try to summon Stoptest.sh/Shutdown.sh on the Windows machine that run tests, nothing happens.
How can I stop tests remotely? It has anything to do with the listening port? Thank you.
PS: Tests are ran using PSExec from Jenkin's Windows slave so there is no active CMD window on the screen.
Be aware that .sh is extension for Linux shell scripts, they cannot be executed by Windows command-line interpreter (CMD or Powershell) if you're running JMeter on Windows you need to go for shutdown.cmd or stoptest.cmd instead
There is also AutoStop Listener plugin which can be used for conditional stopping of JMeter test basing on various criteria, it can be installed using JMeter Plugins Manager
I have a situation where in I need to copy set of files to a windows server through Jenkins. I see a lot of Jenkins plugins that will do this kind of job through ssh but not in my case. Jenkins is also hosted in a windows server and end server is also a windows, so I believe ssh is not an option. Any plugin available in the market to get the job done or writing our requirements in powershell/MSDos script is the only option?
Thanks in advance!
just execute a bat command with the following
copy C:\localfile.bak \\remotemachine\c$\Path\remotefile.bak
in the Using the Execute Windows batch command option in the build Step
How to run bat file in jenkins
I have a console application that needs to be permanently running on the same machine on which I run Jenkins. After I build and publish the .exe file I need to run it but if I try to use bat "pathtofile\\filename.exe", the pipeline will wait for the process to finish, but it never will because the process is a socket server which keeps running and listening.
Is there a way to Run a Fire-and-Forget command to start the .exe?
Have you considered creating a Windows Service? If this is not an option, I would suggest using the /B flag of the start command. For example,
start /B yourapp.exe
will execute your app in the background, somewhat similar to Linux's yourapp & command form.
To check out all the options of the start command, you can type help start in a Command Line Window.
Jenkins gives guidance and examples on this for freestyle projects (but the principle should be the same for pipeline), see:
https://wiki.jenkins.io/display/JENKINS/Spawning+processes+from+build
For Windows, there are a number of options - using the at command (runs a job at specific time); creating a wrapper script to run your bat file; or creating a scheduled task (thus similar to the at command). I've used the schedule task approach (again for freestyle builds rather than pipeline).
I'm running Jenkins as Windows service on my PC. I'm trying to learn to use it. For a dummy job, one of the build step is Execute Windows batch command with the following command
JLink -ip 10.12.1.234
When I build the job on Jenkins I get a build error saying JLink is not recognized as internal or external command, operable program or batch file. When I run the command from a command prompt, it runs without any problem. Windows path has been set to the path where JLink is installed. Should I be configure anything additionally in Jenkins?
Try putting the fully qualified path (or an environment variable) of the command in Configure Project. Your user must be different from jenkins service, which runs as system
I would want to execute the shell script using Jenkins.
For example, I have a shell script MakeTest.sh which is on the server "test1.test2.net" location "/home/rt", how would I execute it? My Jenkins and script to be executed are in different servers.
Thanks!
Using git, you can download the file into the workspace of your job.
After you just have to launch the script ./MakeTest.sh