I just start learning Selenium, but it seems that my ChromeDriver version is incompatible with my current Chrome version? Any help would be appreciated:
The following is the error message I got:
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
[1556601048.968][SEVERE]: Unable to receive message from renderer
org.openqa.selenium.SessionNotCreatedException: session not created
from disconnected: Unable to receive message from renderer
(Session info: chrome=74.0.3729.108)
(Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 10.0.17763 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 17.07 seconds
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:28.403Z'
My original code:
package com.selenium.webdriver.basic;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class First {
/**
* webdriver is a thing where all my functions are
* which is going to control the browser
* and manages the functions which will let me the browser's property
*/
WebDriver driver;
public void invokeBrowser() {
try {
System.setProperty("webdriver.chrome.driver", "C:\\Selenium_tutorial\\chromedriver_win32\\chromedriver.exe");
driver = new ChromeDriver(); //instantiate your chrome driver
driver.manage().deleteAllCookies();//use driver as object reference
// driver.manage().window().maximize(); //always minimize by default
//bait synchronization. always need this
driver.manage().timeouts().implicitlyWait(3600, TimeUnit.SECONDS); //element detection timeout
driver.manage().timeouts().pageLoadTimeout(3600, TimeUnit.SECONDS);
driver.get("https://www.google.ca/");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
First myObj = new Fisrt();
myObj.invokeBrowser();
}
}