0

I am trying to launch the browser with the simple code , the problem i am facing is browser window is getting open but it is showing data and it is not hitting the google url.

public class SeleniumBrowserLaunch {

    public static void main (String[] args) {
        System.setProperty("webdriver.chrome.driver", "D:\\Study_material\\Selenium_setup\\chromedriver_win32\\chromedriver.exe");
        WebDriver driver = new ChromeDriver();
        driver.manage().window().maximize();
        driver.get("https://www.google.com/");
    }
}

Error i am getting is this: java.io.IOException: Invalid Status code=403 text=Forbidden Unable to establish websocket connection to http://localhost:58703/devtools/browser/83403c9d-252d-40af-b350-a36926a5a929

Below are the screenshots for errors.

enter image description here enter image description here

I need help to resolve this error. Thanks in advance.

  • 2
    Refer this - https://stackoverflow.com/questions/75718422/org-openqa-selenium-remote-http-connectionfailedexception-unable-to-establish-w – Shawn Mar 17 '23 at 14:18
  • Possibly related: [Unable to establish websocket connection](https://stackoverflow.com/q/75680149/12567365). – andrewJames Mar 17 '23 at 14:21
  • This got resolved for me. The problem was with the java, selenium and testNG versions compatibility. I was using java 14 with selenium 4 and testng version as higher than 7.5 which didnt work. The correct one is java 8 , selenium 3 and testNG versions should not be higher than 7.5. Is this is correct and we would probably not need selenium jdk client. – Nitee Asswani Mar 20 '23 at 13:11

0 Answers0