I am using Jenkins to schedule my selenium/java automated tests (test scripts packaged into a .jar
file).
I have created a .bat
file to trigger the .jar
file and i am calling the .bat
file from Jenkins.
When I manually trigger the tests, by double clicking on .bat
file, everything runs smoothly. But when I try to run the same through Jenkins, I am getting the following error for each test case:
"The system cannot find the file specified"
Jenkins is calling the .bat
file successfully, because I can see the test case name (which is present within .jar
file) displayed on the jenkins console.
In my java code, I have used .\
to represent the "current directory" where my jar file is present along with an excel file which data drives the automation framework. Even the .bat
file is present in the same location, and I have given fully qualified path on both .bat
file and on jenkins.
I can't hardcode and will have to use ./
in my java code. And I am running this on Windows Server (not my local machine).