0
votes

I have one requirement of running automation scripts on chrome - Mac machine

All my automation code base is on windows 7

I have created selenium grid node on mac downloading chrome driver on mac and configured targeted mac url in the test scripts.

Next step that followed is adding System.setProperty("webdriver.chrome.driver" ..) downloading chrome driver in windows machine and setting the path as System.setProperty("webdriver.chrome.driver", "C://Users//nandhsri//MyWork//SeleniumJars//chromedriver");

But it failed to execute test scripts from windows to run on mac and displayed the following error : Caused by: org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.9.248307,platform=Mac OS X 10.8.5 x86_64)

And also tried downloading chrome driver in MAC machine and setting the path as System.setProperty("webdriver.chrome.driver", "\Users\admin\Downloads\chromedriver");

but it displayed the same error ..

Is that I am missing any thing ..

Can any one help in this chrome driver grid setup to run remotely on mac from windows machine

1
If you're running the ChromeDriver on your mac, you'll need to specify where the binary is located on the Mac, not on your Windows machine. - Mark Rowlands

1 Answers

1
votes

Mac uses forward slash instead of backward slashes. To get around this in Java try this:

System.setProperty("webdriver.chrome.driver", File.separator + "Users" + File.separator + "admin"+File.separator + "Downloads" + File.separator + "chromedriver");