Troubleshooting Selenium: Encountering connectivity issues with Chrome upon introducing the `--remote-debugging-port=<port>` parameter to Edge options

Code:

    EdgeOptions edgeoptions = new EdgeOptions();
    edgeoptions.addArguments("--remote-debugging-port=14837");
    edgeoptions.addArguments("--start-maximized");
    edgeoptions.addArguments("user-data-dir=C:\\Users\\jagadish\\AppData\\Local\\Microsoft\\Edge\\User Data");
    edgeoptions.addArguments("profile-directory=Profile 2");
    WebDriver driver = new EdgeDriver(edgeoptions);

Error:

Microsoft Edge WebDriver was started successfully.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Microsoft Edge failed to start: exited normally.
  (**chrome not reachable**)
  (The process started from msedge location C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe is no longer running, so msedgedriver is assuming that msedge has crashed.) 
Host info: host: 'JAGADISH-LAPTOP', ip: '192.168.1.105'
Build info: version: '4.7.2', revision: '4d4020c3b7'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.1'
Driver info: org.openqa.selenium.edge.EdgeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: MicrosoftEdge, ms:edgeOptions: {args: [--remote-debugging-port=14837, --start-maximized, user-data-dir=C:\Users\jaga..., profile-directory=Profile 2], extensions: []}}], desiredCapabilities=Capabilities {browserName: MicrosoftEdge, ms:edgeOptions: {args: [--remote-debugging-port=14837, --start-maximized, user-data-dir=C:\Users\jaga..., profile-directory=Profile 2], extensions: []}}}]

During the test, I decided to switch profiles and added additional Edge options. The driver successfully launched but threw an error stating "devtoolsactiveport file doesn't exist edge selenium."

I found a solution on https://stackoverflow.com/questions/66682566/ms-edge-driver-error-devtoolsactiveport-file-doesnt-exist-works-only-with, where it suggested adding --remote-debugging-port=14837. However, I am now encountering the "chrome not reachable" error.

Answer №1

If you're encountering issues, consider terminating all edgedriver processes before attempting to restart

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Initiate a react change event using Appium

I'm currently working on automating a hybrid app that has a login screen implemented as a react web view, and unfortunately, I don't have control over it. The challenge I'm facing is that the Sign-in button remains disabled until something i ...

Developing React applications using Behavior Driven Development with a personalized API call for simulating mock

Currently, I am utilizing BDD with cucumberjs, selenium-webdriver & react. Within a specific scenario, I wish to execute a Mock API call rather than an actual API call. For instance, I am currently making a call to: http://example.com/v1/getData However ...

Guide on how to use Selenium to drag and drop a canvas web element specifically in the Chrome browser

Having trouble moving an image within the canvas web element (avatar editor) on Chrome using Selenium. Check out this canvas element: Watch a quick demo of what I'm trying to accomplish with Selenium Webdriver: Please review the code snippet below. ...