I am trying to run my first selenium test and failed invoking the browser due to port issue. My chrome browser version is Version 78.0.3904.97 (Official Build) (64-bit) and i have downloaded Latest stable release: ChromeDriver 78.0.3904.70. I see the below error when i run my script.
Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}) on port 30211 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code. [1573154573.453][WARNING]: Timed out connecting to Chrome, retrying... Nov 07, 2019 7:22:56 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: W3C Exception in thread "main" org.openqa.selenium.InvalidArgumentException: invalid argument
(Session info: chrome=78.0.3904.97) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
I have downloaded the latest chromedriver exe which is compatible with my chromebrowser version.
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class demo1 {
public static void main(String[] args) {
//invoke browser
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\270816\\Documents\\Selenium-
installations\\chromedriver_win32\\chromedriver.exe");
//create browser object
WebDriver driver= new ChromeDriver();
//hit google.com
driver.get("www.bbc.co.uk");
Error message:
Starting ChromeDriver 78.0.3904.70 (edb9c9f3de0247fd912a77b7f6cae7447f6d3ad5-refs/branch-heads/3904@{#800}) on port 30211 Only local connections are allowed. Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.