I have imported my selenium code from windows to mac and installed chromedriver for mac and updated systemproperty accordingly.but it is throwing exception and showing previously set path:
java.lang.IllegalStateException: The driver executable does not exist: /Users/Preet12/Desktop/Selenium/AddaStore/C:\Users\cp\Downloads\chromedriver_win32\chromedriver.exe
however the path in mac is : /Users/Preet12/Desktop/Selenium/AddaStore/chromedriver 2
it is showing path of window also i.e. C:\Users\cp\Downloads\chromedriver_win32\chromedriver.exe
Code:
public class WithTestNG
{
WebDriver driver;
@BeforeClass
public void StartBrowser()
{
System.setProperty("webdriver.chrome.driver","/Users/Preet12/Desktop/Selenium/AddaStore/chromedriver 2" );
driver = new ChromeDriver();
driver.manage().window().maximize();
}