Reputation:
I am very new in developing world so my apologies in advance if my question sounds weird. I have written a test with Selenium and JAVA and made a jar file from it, now I am wondering if there is any way that this jar file can be run every 1 hour automatically, I mean there should be no one clicking on the jar file or any running program to run it.
Upvotes: 1
Views: 6784
Reputation: 846
If you are on a unix based system, you could run the jar as a cronjob. The following would run a jar every 30 seconds.
0 */1 * * * java -jar /path/to/jar/myjar.jar Read the following to learn how to setup a cronjob correctly https://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job
For windows, use task scheduler. Go to https://stackoverflow.com/a/26932169/802061 for more details.
Upvotes: 0
Reputation: 9662
You can also run Jenkins, and create a job to execute the jar every hour. The nice part about this is you get a web-based UI and an easy way to view the output from the tests.
Upvotes: 1
Reputation: 6675
You can use an OS built job scheduler or use a tool which would make your jobs run.Also you could have a main Java program running infinitely and a child process spawning every 60*60*1000 milliseconds .
Upvotes: 1
Reputation: 1002
Upvotes: 2