I am getting the following error while executing the JAR from the command line
Execution from Maven works properly
I am reusing the TestListner from the downloaded code. is it something to do with that?
Thanks,
Prasanth
Instructor
Ashish Thakur Replied on 30/04/2021
Which jar
I am not able to understand
I need to create a runnable JAR for the automation project and run it through a BAT file. It seems the JAR is not mapping {"user.dir"} for the path of browser driver and properties file. When I provide a hardcoded path it works, but then that is not the proper way
Instructor
Ashish Thakur Replied on 02/05/2021
is your project running from testng.xml
OR from a java file?
Java file. i have created the main application. everything works fine while running from IDE as Run as Java Application. but when i create a runnable jar and try to run from a bat file it doesn't. I hardcoded the path of the chrome driver and then it recognized the driver but failed at loading the properties file (its failing at finding elements, so i guess property files were not loaded)
How can I create a runnable Jar which works fine without hardcoding the project paths?
Instructor
Ashish Thakur Replied on 18/05/2021
I am sorry for late reply. I was not well
You cant do that
You will have to suppkly the paths of the drivers to jar from command prompt and run
Like we do in grid..