Data driven framework jar export

261 Views Asked by At

I have created a data driven framework in Selenium by using Java, Eclipse and an Excel file. I have exported the runnable jar file which executes perfectly in my system but it is not executing on others due to path problems. I wanted to know whether there is any specific way to use a data driven jar file in different systems by solving it's path problems? Or, do I have to do all installations and ensure all related resources are in the system on which I want to execute?

1

There are 1 best solutions below

3
On

Use user.dir key for get project location using java.

Code:

System.out.println("Present Project Directory : "+ System.getProperty("user.dir"));

Use System.getProperty("user.dir") which require path and append the folder as per required in your project folder.

This is how you dynamically add the path. what ever the system it is. it will take the path of project directory dynamically

Hope it will help you :)