MicrosoftEdge / EdgeWebDriver

Feedback and discussions about WebDriver for Microsoft Edge
MIT License
55 stars 7 forks source link

Why edgedriver is crashed , response code 500 ? #66

Open alanliew88 opened 1 year ago

alanliew88 commented 1 year ago

Here are the error message.

Only local connections are allowed.
Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.

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: crashed.
  (chrome not reachable)
  (The process started from msedge location /Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge is no longer running, so msedgedriver is assuming that msedge has crashed.)
Build info: version: '4.4.0', revision: 'e5c75ed026a'
System info: host: 'Alans-MacBook-Pro.local', ip: 'fe80:0:0:0:1c1d:b4b6:77a2:3994%en0', os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '12.3', java.version: '19.0.1'
Driver info: org.openqa.selenium.edge.EdgeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: MicrosoftEdge, ms:edgeOptions: {args: [--no-sandbox, --disable-dev-shm-usage], extensions: []}}], desiredCapabilities=Capabilities {browserName: MicrosoftEdge, ms:edgeOptions: {args: [--no-sandbox, --disable-dev-shm-usage], extensions: []}}}]
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:144)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:102)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:167)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:142)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:547)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:157)
    at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:101)
    at org.openqa.selenium.edge.EdgeDriver.<init>(EdgeDriver.java:54)
    at org.openqa.selenium.edge.EdgeDriver.<init>(EdgeDriver.java:46)
    at testingdriver.main(testingdriver.java:29)

Here is my pom.xml

\<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --\>
\<dependency\>
\<groupId\>org.seleniumhq.selenium\</groupId\>
\<artifactId\>selenium-java\</artifactId\>
\<version\>4.4.0\</version\>
\</dependency\>

\<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager --\>
\<dependency\>
\<groupId\>io.github.bonigarcia\</groupId\>
\<artifactId\>webdrivermanager\</artifactId\>
\<version\>5.3.1\</version\>
\</dependency\>

Here is my script :

WebDriverManager.edgedriver().setup();

EdgeOptions options = new EdgeOptions();

options.addArguments("--no-sandbox");
options.addArguments("--disable-dev-shm-usage");
WebDriver driver = new EdgeDriver(options);

driver.get("https://google.com");
System.out.println("success");
driver.quit();

This is happening when I'm using webdrivermanger and even I declare the path of the webdriver.

What I noticed is that the edgedriver can only run properly when it is in headless mode. (Which is weird)

AB#43012321

alanliew88 commented 1 year ago

In Mac, I can see the edge browser is appearing on the menu bar. However, it crashed after a few seconds.

gregma commented 1 year ago

I can verify this is happening to me. Selenium-Java version 4.7.2, webdrivermanager 5.3.1

Driver msedgedriver 109.0.1518.55

bwalderman commented 1 year ago

Thank you for reporting this. I have verified that Edge and msedgedriver 109.0.1518.52 work on an intel based Mac. I haven't been able to test on an M1 Mac yet. Adding this to our team's internal backlog for investigation.

satishkovuru commented 1 year ago

Hello, We have the same issue providing the logs below for a Java Project.

Starting Microsoft Edge WebDriver 109.0.1518.49 (a0ba3a09d1b75211882758182c96ccb56aec7b7d) on port 64958 To submit feedback, report a bug, or suggest new features, please visit https://github.com/MicrosoftEdge/EdgeWebDriver

Only local connections are allowed. Please see https://aka.ms/WebDriverSecurity for suggestions on keeping Microsoft Edge WebDriver safe.

Microsoft Edge WebDriver was started successfully. / Caused by: net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate new WebDriver instance of type class net.thucydides.core.webdriver.ProvidedDriver (Could not instantiate the custom webdriver provider of type mydriver). See below for more details. Caused by: java.lang.RuntimeException: Could not instantiate the custom webdriver provider of type mydriver Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: Microsoft Edge failed to start: crashed. (unknown error: DevToolsActivePort file doesn't exist) (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.)

Gaya33333 commented 1 year ago

I am also facing this issue, only in Selenium 4 versions