
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Unable to Launch Chrome Browser on Mac Using Selenium WebDriver
While working with Selenium webdriver, we may be unable to launch the Chrome browser on Mac. However, it can be avoided by following the steps listed below −
Step1 − Navigate to the link:https://sites.google.com/chromium.org/driver/ and click on the download link of the chromedriver version which is compatible with our local chrome browser.
Step2 − Click on the chromedriver link available for the Mac operating system.
Step3 − Once the download of the zip file gets completed, unzip it to get the chromedriver.exe file. Save it to a desired location.
Step4 − While mentioning the path of the chromedriver.exe file in the System.setProperty method, we can mention only chromedriver instead of chromedriver.exe.
Code Implementation
import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; public class FirstAssign { public static void main(String[] args) { //configure path of chromedriver.exe System.setProperty("webdriver.chrome.driver", "chromedriver"); //ChromeDriver instance WebDriver driver = new ChromeDriver(); //implicit wait driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); //url launch driver.get ("https://www.tutorialspoint.com/about/about_careers.htm"); System.out.println("Page title: "+ driver.getTitle()); //browser quit driver.quit(); } }