An Nihal
An Nihal

Reputation: 1

"Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: net::ERR_CONNECTION_CLOSED"

I am new in QA and i tried to automate for the first time in Microsoft Edge Version 109.0.1518.61 and getting these errors: These are the error i am getting first2nd error

I am using this as a maven project. There is no error in the code blocks.My whole code block is given below:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

public class BrowserTest {

    public static void main(String[] args) {
        
        
        
        EdgeOptions options = new EdgeOptions();
        options.addArguments("edge.switches","--disable-extensions");
        WebDriver Driver = new EdgeDriver(options);
        
        Driver.get("https://seleniumhq.org/");
    }

}

Upvotes: 0

Views: 611

Answers (1)

Shawn
Shawn

Reputation: 8478

The error is in your below line:

Driver.get("https://seleniumhq.org/");

This happens when the URL you are trying to hit is not reachable, URL is blocked by a proxy etc. If you are not specific about using this URL, then try the below code:

Driver.get("https://www.selenium.dev/");

On another note, as a best practice follow java standard naming conventions. For example variable name Driver should be driver

Upvotes: 1

Related Questions