RE: How to make TestNG automation scripts executable outside the eclipse?
I have written an automation script in eclipse using Selenium TestNG. Now I have to make them executable outside eclipse, so that in every 1 hour the scripts run on their own through a job and send a email to me.
Can it be possible to do ? If yes, please tell how?
Use below command to run your scripts outside of selenium.
java -cp "/opt/testng-6.8.jar:bin" org.testng.TestNG testng.xml
In the preceding command we are adding the TestNG JAR and the project compiled code to the Java classpath by using the
-cp option of Java.
/opt/testng-6.8.jar is the path to the
testng JAR where you had downloaded it and it may be different for your system. Also,
bin is the folder containing the compiled code of the Java project. This can be found under the Eclipse project, which is under consideration.
and you can run jobs by using cron expression at cron tab.