I have scripted a Selenium automation testcase. I have generated the testng.xml file which should be executed on the linux terminal at a particular time of my need. Say I want to schdule to execute the testng.xml file on terminal at 11pm everyday.
Authomation of the task can be done on this way: Create in your home directory a script (with name script.sh for example) which contain:
#do not forget to set propper path to java executable JAVA=/usr/bin/java source /home/dananja/.bash_profile cd /home/dananja/workspace/simsapp $JAVA -cp "./lib/*:./bin" org.testng.TestNG testng.xml
And in cron (via command
crontab -e) add record like this:
0 23 * * * /home/dananja/script.sh
To make your script executable do not forget to exec (once)
chmod +x /home/dananja/script.sh