I am using Java 1.8 and Selenium 2.53.0. I have taken these and created a lib/jar using maven that handles driver instantiation. In that lib I also packaged the ChromeDriver.exe in the assets folder.
In my other project I have called that lib as a dependency and I'm using the AutomationDriver object from inside my lib. In the lib it automatically instantiates any driver I call for with the settings I've already specified. However, it's a special case with ChromeDriver.exe because it needs to have
System.setProperty("webdriver.chrome.driver", "./path/to/chromedriver");
set to reference the path. I was using relative paths in my project before and it worked fine, but now that I have it as a lib I can't seem to figure out the relative path that would reach the asset within the lib so that it will work on every machine without having to download/route to another ChromeDriver.
- How is the relative path to an asset within a lib/jar handled?
- How can I set my system property to use that asset?
- Is there a way that it can query it's own path to it automatically and use that?