Example Selenium RC Batch File

Use notepad to create a file named whatever you like, but using the .bat file extension. i.e.,

myexamplebatchfile.bat

Copy and paste the code below into the file:

START java -jar C:\selenium\selenium-server-standalone-2.31.0.jar -port 4445 -firefoxProfileTemplate "C:\ffprofiles\selenium" -htmlSuite "*chrome" "http://www.google.com" "C:\path\to\script\suite-exampletests.html" "C:\path\to\script\report\report.html"

Modify the variables for your script need and save the file. Either double click the file run it, or setup a Windows Scheduled Task to run it at a specific time.

Note: There are many articles on the internet to show you how to setup your own custom Firefox profile, which is HIGHLY recommended.

1 Comment

In some cases, where your

In some cases, where your scripts are stored on a mapped drive, and you are using Task Scheduler to automatically launch those scripts at scheduled times, and the user the Task Scheduler run as does not have the drive mapped before starting the Java server, yolu need to add the following command to your batch file to map the drive first:

NET USE A: "\\some\mapped\drive\directory\"

This tells windows to map the drive, thereby making that drive accessible to Task Scheduler to find the script files. The drive will be mapped using the user name and password the tasks is set to run as.