.I have created a runnable Jar using Eclipse. The IEDriverServer.exe is present in the Jar. I am treating IEDriverServer.exe as a resource for the project.
The below line of code
System.setProperty("webdriver.ie.driver", "C:/Folder1/RunnableJar.jar/IEDriverServer.exe");
throws Driver executable doesn't exist in the following path
.
I have put IEDriverServer.exe in the bin folder of the project. I am using the below line of code to get the path of IEDriver that is present in the bin folder.
MainClassName.class.getProtectionDomain().getCodeSource()
.getLocation().getPath() + "/IEDriverServer.exe";
If I am running the code from Eclipse then the path is the path to the IEDriverServer present in the bin folder. If I am exporting the project as a runnable Jar then the path is as shown below
C:/Folder1/RunnableJar.jar/IEDriverServer.exe
If I am running it from the eclipse it works fine.
It throws the exception if I am running it as jar.
I would like to know the way to set IEDriverServer.exe property from within the Runnable jar.