Configuration Error | Selenium Forum
PRASANTH VARMA Posted on 24/04/2021

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?




Ashish Replied on 30/04/2021

Which jar

I am not able to understand

PRASANTH VARMA Replied on 30/04/2021

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

Ashish Replied on 02/05/2021

is your project running from testng.xml

OR from a java file?

PRASANTH VARMA Replied on 02/05/2021

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?