In my selenium tests, I have a ChromeDriver path encoded using
System.setProperty("webdriver.chrome.driver", "C:\\Users\\kday\\Desktop\\Selenium Stuff\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
However, this means that when I export the program as a jar executable, the test will not work because it cannot find the hard path (if it is on another computer). Is there any way to do this so that either ..
a.) - ChromeDriver is part of the jar and works with it
b.) - I can initialize it in code without hard coding the value in this
Basically, I want all tests to be executed (in IE, Chrome, FF), just by launching the jar.
source
share