Reputation: 215
I have a config class that references a chromedriver.exe file via a String path like so
public static final String CHROMEDRIVER_DIRECTORY = "C:\\Users\\asdf\\Desktop\\Testing\\drivers\\chromedriver.exe";
That code is located in the src folder while the chromedriver.exe is located in a separate drivers folder. The project layout looks something like this.
Testing
How can I edit the string so that it can find the chromedriver without having to type the absolute path? Thanks
Upvotes: 0
Views: 274
Reputation: 66
Keep your chromedriver.exe in one folder in your current project directory(say win). Then use
System.getProperty("user.dir") + File.separator + "win" + File.separator + "chromedriver.exe"
Upvotes: 0