When I try to run my project using Selenium and Java, I am getting this error and I do not know how to solve it. This is happening on VSCode and the SO is Windows 11.
org.openqa.selenium.WebDriverException: unknown error: net::ERR_CONNECTION_REFUSED
(Session info: chrome=108.0.5359.125)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
This is the code I created:
WebDriver browser = new ChromeDriver();
browser.navigate().to("http://localhost:8080/leiloes");
browser.quit();
I appreciate your help.
Marcelo
You need to set the property of webdriver like below, and you can use get instead of driver.get("http://www.facebook.com");
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class TestChrome {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "path of the exe file\\chromedriver.exe");
// Initialize browser
WebDriver driver = new ChromeDriver();
// Open facebook
driver.get("http://www.facebook.com");
// Maximize browser
driver.manage().window().maximize();
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.