

What is Selenium ChromeDriver?ĬhromeDriver is a standalone server that develops a communication medium with Selenium WebDriver Chromium Protocol. Once the connection gets established, we are good to go with selenium tests on the chrome browser. It is primarily used to write scripts to automate the end-user interactions and to test site functionality in a much faster way.Ĭhrome officially provides an OS-dependent driver which establishes a connection between Selenium WebDriver and Google Chrome browser. Selenium is an open-source project offering a variety of tools and libraries for web browser automation. To overcome this challenge, it is necessary to perform test automation on the chrome browser.

Performing different test cases manually on different chrome versions can be hectic and challenging.

Hence, it becomes essential to test our web application on such a high-rated browser. Every new chrome version comes up with an exciting feature that hikes the importance and usage of the chrome browser. HashMap chromeOptionsMap = new HashMap() ĭesiredCapabilities cap = DesiredCapabilities.chrome() Ĭap.setCapability(ChromeOptions.CAPABILITY, chromeOptionsMap) Ĭap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true) Ĭap.setCapability(ChromeOptions.CAPABILITY, options) ĭriver.findElement(By.linkText("32 bit Windows IE")).As per the browser market share, Google Chrome is said to be the most used cross-platform browser in the world. Note – Selenium version 3.10 onwards – ChromeDriver(cap) is deprecated, need to use only ChromeOptionsįor older versions of selenium chromePrefs = new HashMap() String downloadFilepath = "C:\\Users\\uname\\sel" The above specified path is for Mac OS, if you are using windows, then you can change the path accordingly tProperty("","C:\\Users\\uname\\sel\\chromedriver.exe") tCapability(CapabilityType.ACCEPT_SSL_CERTS, true) ĭriver.findElement(By.linkText("32 bit Windows IE")).click() įile will be downloaded under sel folder. Options.addArguments("-disable-extensions") //to disable browser extension popup tExperimentalOption("prefs", chromePrefs) String downloadFilepath = "/Users/uname/sel/" ĬhromePrefs.put("fault_content_settings.popups", 0) ĬhromePrefs.put("fault_directory", downloadFilepath) ĬhromeOptions options = new ChromeOptions()

tProperty("","/Users/uname/sel/chromedriver") We will use ChromeOptions to set browser preferences ĭownload the Chrome driver with respect to your browser version from
