SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.47k stars 8.15k forks source link

[🐛 Bug]: After importing project on new machine with latest java got 'exception was thrown by TimerTask' #11938

Closed akm1967 closed 9 months ago

akm1967 commented 1 year ago

What happened?

Code was working fine older version of Java 9.0.4 & Selenium 4.8.3 but when I installed latest Java in different computer which has Windows 10. Started getting errors.

How can we reproduce the issue?

Steps:
1. Installed Latest Eclipse version - Version: 2023-03 (4.27.0)
Build id: 20230309-1520
2. Install latest version of Java in my case - 
java -version
java version "20.0.1" 2023-04-18
Java(TM) SE Runtime Environment (build 20.0.1+9-29)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)
3. Import project
4. Found error for slf4j then added dependency for it latest version 2.0.7
5. Run the code which was working with Java 9.0.4 & Selenium 4.8.3

Relevant log output

SLF4J: No SLF4J providers were found.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See https://www.slf4j.org/codes.html#noProviders for further details.
Starting ChromeDriver 112.0.5615.49 (bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936}) on port 19135
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Apr 24, 2023 8:11:00 PM io.netty.util.HashedWheelTimer$HashedWheelTimeout run
WARNING: An exception was thrown by TimerTask.
java.lang.NoClassDefFoundError: com/typesafe/netty/HandlerPublisher
    at java.base/java.lang.ClassLoader.defineClass1(Native Method)
    at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
    at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
    at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
    at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    at org.asynchttpclient.netty.request.NettyRequestSender.abort(NettyRequestSender.java:474)
    at org.asynchttpclient.netty.timeout.TimeoutTimerTask.expire(TimeoutTimerTask.java:43)
    at org.asynchttpclient.netty.timeout.RequestTimeoutTimerTask.run(RequestTimeoutTimerTask.java:50)
    at io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTimer.java:715)
    at io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor.java:34)
    at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:703)
    at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:790)
    at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: com.typesafe.netty.HandlerPublisher
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    ... 19 more

Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. 
Host info: host: 'LAPTOP-VRJ82T52', ip: '192.168.29.197'
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:561)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:229)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:157)
    at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:101)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:84)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:52)
    at basic.Start.main(Start.java:24)
Caused by: org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException
Build info: version: '4.9.0', revision: 'd7057100a6'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6'
Driver info: driver.version: ChromeDriver
    at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:65)
    at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
    at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56)
    at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:49)
    at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
    at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56)
    at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:99)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:112)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:94)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:165)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:183)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
    ... 7 more
Caused by: java.util.concurrent.TimeoutException
    at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1960)
    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095)
    at org.asynchttpclient.netty.NettyResponseFuture.get(NettyResponseFuture.java:206)
    at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:59)
    ... 20 more

Operating System

Windows 10

Selenium version

4.9.0

What are the browser(s) and version(s) where you see this issue?

Version 112.0.5615.138 (Official Build) (64-bit)

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 112.0.5615.49 (bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936}) on port 19135

Are you using Selenium Grid?

No

github-actions[bot] commented 1 year ago

@akm1967, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

titusfortner commented 1 year ago

How did you install the driver (or are you letting Selenium handle it?)

Selenium 4.9 added the specific error from http response to the logs. Can you turn on logging? (Or use this utility https://github.com/titusfortner/selenium-logger).

Logs will show what Selenium Manager is doing, what capabilities are sent to the driver, and what the http client is getting in response.

akm1967 commented 1 year ago

I let Selenium handle for driver. Please find the log after setting - new SeleniumLogger().setLevel(Level.FINE); 2023-04-24 21:17:17 FINE - Executing: newSession [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*], extensions: []}}]}] Starting ChromeDriver 112.0.5615.49 (bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936}) on port 3012 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. 2023-04-24 21:20:18 FINE - Exception: newSession java.util.concurrent.TimeoutException Build info: version: '4.9.0', revision: 'd7057100a6' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6' Driver info: driver.version: ChromeDriver Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'LAPTOP-VRJ82T52', ip: '192.168.29.197' at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:561) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:229) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157) at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:101)

titusfortner commented 1 year ago

Hmm, logs look right; it's just timing out... Actually, are you sure you have Chrome installed, if it is a new machine? (don't laugh, this happens more than you'd think). If it's installed, very the version and it's in the default location?

akm1967 commented 1 year ago

It is old machine only. Just restored the windows 10. Chrome was already installed.

akm1967 commented 1 year ago

Google Chrome Chrome is up to date Version 112.0.5615.138 (Official Build) (64-bit)

akm1967 commented 1 year ago
    Code I used:
    new SeleniumLogger().setLevel(Level.FINE);
    driver = new ChromeDriver();
    driver.manage().window().maximize();
    driver.get("https://demo.guru99.com/test/newtours/index.php");
titusfortner commented 1 year ago

Hmmm... What is the driver seeing?

Try:

ChromeDriverService service = new ChromeDriverService.Builder()
        .withVerbose(true)
        .withReadableTimestamp(true)
        .build();
driver = new ChromeDriver(service);
akm1967 commented 1 year ago

After adding Service:

2023-04-24 22:21:27 FINE - Executing: newSession [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=], extensions: []}}]}] Starting ChromeDriver 112.0.5615.49 (bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936}) on port 22874 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. [1682355087.858][INFO]: [f737cd04814becee00e6ddbc803efb52] COMMAND InitSession { "capabilities": { "firstMatch": [ { "browserName": "chrome", "goog:chromeOptions": { "args": [ "--remote-allow-origins=" ], "extensions": [ ] } } ] } } [1682355087.870][INFO]: Populating Preferences file: { "alternate_error_pages": { "enabled": false }, "autofill": { "enabled": false }, "browser": { "check_default_browser": false }, "distribution": { "import_bookmarks": false, "import_history": false, "import_search_engine": false, "make_chrome_default_for_user": false, "skip_first_run_ui": true }, "dns_prefetching": { "enabled": false }, "profile": { "content_settings": { "pattern_pairs": { "https://,": { "media-stream": { "audio": "Default", "video": "Default" } } } }, "default_content_setting_values": { "geolocation": 1 }, "default_content_settings": { "geolocation": 1, "mouselock": 1, "notifications": 1, "popups": 1, "ppapi-broker": 1 }, "password_manager_enabled": false }, "safebrowsing": { "enabled": false }, "search": { "suggest_enabled": false }, "translate": { "enabled": false } } [1682355087.871][INFO]: Populating Local State file: { "background_mode": { "enabled": false }, "ssl": { "rev_checking": { "enabled": false } } } [1682355087.879][INFO]: Launching chrome: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --allow-pre-commit-input --disable-background-networking --disable-backgrounding-occluded-windows --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --log-level=0 --no-first-run --no-service-autorun --password-store=basic --remote-allow-origins=* --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir="C:\Users\Vandana\AppData\Local\Temp\scoped_dir13856_77980912" data:, [1682355088.704][DEBUG]: DevTools HTTP Request: http://localhost:62886/json/version [1682355089.082][DEBUG]: DevTools HTTP Response: {

"Browser": "Chrome/112.0.5615.138",

"Protocol-Version": "1.3",

"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",

"V8-Version": "11.2.214.14",

"WebKit-Version": "537.36 (@b160f1d9e90aa6940d17d5cb44d9e815205d2024)",

"webSocketDebuggerUrl": "ws://localhost:62886/devtools/browser/e7be322a-1a1c-4c79-b01e-379192635881"

}

[1682355089.082][DEBUG]: DevTools HTTP Request: http://localhost:62886/json/list [1682355089.116][DEBUG]: DevTools HTTP Response: [ {

"description": "",

"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:62886/devtools/page/E5A358E01CDB686F92CC0CF3CA5E7C21",

"id": "E5A358E01CDB686F92CC0CF3CA5E7C21",

"title": "",

"type": "page",

"url": "data:,",

"webSocketDebuggerUrl": "ws://localhost:62886/devtools/page/E5A358E01CDB686F92CC0CF3CA5E7C21"

} ]

[1682355089.153][INFO]: resolved localhost to ["::1","127.0.0.1"] [1682355089.155][DEBUG]: DevTools WebSocket Command: Target.getTargets (id=1) (session_id=) browser { } [1682355089.156][DEBUG]: DevTools WebSocket Response: Target.getTargets (id=1) (session_id=) browser { "targetInfos": [ { "attached": false, "browserContextId": "CD1E93B43AF7DFBA66E37EA1AF742D36", "canAccessOpener": false, "targetId": "E5A358E01CDB686F92CC0CF3CA5E7C21", "title": "", "type": "page", "url": "data:," } ] } [1682355089.156][DEBUG]: DevTools WebSocket Command: Target.attachToTarget (id=2) (session_id=) browser { "flatten": true, "targetId": "E5A358E01CDB686F92CC0CF3CA5E7C21" } [1682355089.160][DEBUG]: DevTools WebSocket Event: Target.attachedToTarget (session_id=) browser { "sessionId": "0722589D24602E0CCC915C55C48CCBAB", "targetInfo": { "attached": true, "browserContextId": "CD1E93B43AF7DFBA66E37EA1AF742D36", "canAccessOpener": false, "targetId": "E5A358E01CDB686F92CC0CF3CA5E7C21", "title": "", "type": "page", "url": "data:," }, "waitingForDebugger": false } [1682355089.160][DEBUG]: DevTools WebSocket Response: Target.attachToTarget (id=2) (session_id=) browser { "sessionId": "0722589D24602E0CCC915C55C48CCBAB" } [1682355089.160][DEBUG]: DevTools WebSocket Command: Page.addScriptToEvaluateOnNewDocument (id=3) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "source": "(function () {window.cdc_adoQpoasnfa76pfcZLmcfl_Array = window.Array;window.cdc_adoQpoasnfa76pfcZLmcfl_Promise = window.Promise;window.cdc_adoQpoasnfa76pfcZLmcfl_Symbol = window.Symbol;}) ();" } [1682355089.161][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=4) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "expression": "(function () {window.cdc_adoQpoasnfa76pfcZLmcfl_Array = window.Array;window.cdc_adoQpoasnfa76pfcZLmcfl_Promise = window.Promise;window.cdc_adoQpoasnfa76pfcZLmcfl_Symbol = window.Symbol;}) ();" } [1682355089.162][DEBUG]: DevTools WebSocket Command: Log.enable (id=5) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.163][DEBUG]: DevTools WebSocket Command: Target.setAutoAttach (id=6) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "autoAttach": true, "flatten": true, "waitForDebuggerOnStart": false } [1682355089.163][DEBUG]: DevTools WebSocket Command: Page.enable (id=7) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.163][DEBUG]: DevTools WebSocket Command: Page.enable (id=8) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.297][DEBUG]: DevTools WebSocket Response: Page.addScriptToEvaluateOnNewDocument (id=3) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "identifier": "1" } [1682355089.306][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=4) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "result": { "type": "undefined" } } [1682355089.306][DEBUG]: DevTools WebSocket Response: Log.enable (id=5) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.306][DEBUG]: DevTools WebSocket Response: Target.setAutoAttach (id=6) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.306][DEBUG]: DevTools WebSocket Response: Page.enable (id=7) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.306][DEBUG]: DevTools WebSocket Response: Page.enable (id=8) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.306][DEBUG]: DevTools WebSocket Command: Runtime.enable (id=9) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.322][DEBUG]: DevTools WebSocket Event: Page.frameStartedLoading (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "frameId": "E5A358E01CDB686F92CC0CF3CA5E7C21" } [1682355089.353][DEBUG]: DevTools WebSocket Event: Page.frameNavigated (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "frame": { "adFrameStatus": { "adFrameType": "none" }, "crossOriginIsolatedContextType": "NotIsolated", "domainAndRegistry": "", "gatedAPIFeatures": [ ], "id": "E5A358E01CDB686F92CC0CF3CA5E7C21", "loaderId": "E6663999DEF4F50EA58FCDBD2E07A976", "mimeType": "text/plain", "secureContextType": "InsecureScheme", "securityOrigin": "://", "url": "data:," }, "type": "Navigation" } [1682355089.353][DEBUG]: DevTools WebSocket Event: Runtime.executionContextCreated (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "context": { "auxData": { "frameId": "E5A358E01CDB686F92CC0CF3CA5E7C21", "isDefault": true, "type": "default" }, "id": 2, "name": "", "origin": "://", "uniqueId": "-5652637758750582889.-5642741690905507299" } } [1682355089.353][DEBUG]: DevTools WebSocket Response: Runtime.enable (id=9) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.353][DEBUG]: DevTools WebSocket Command: Page.enable (id=10) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.354][DEBUG]: DevTools WebSocket Event: Page.loadEventFired (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "timestamp": 27268.289765 } [1682355089.354][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=11) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "awaitPromise": false, "expression": "document.readyState", "returnByValue": true } [1682355089.355][DEBUG]: DevTools WebSocket Event: Page.frameStoppedLoading (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "frameId": "E5A358E01CDB686F92CC0CF3CA5E7C21" } [1682355089.355][DEBUG]: DevTools WebSocket Event: Page.domContentEventFired (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "timestamp": 27268.290471 } [1682355089.356][DEBUG]: DevTools WebSocket Response: Page.enable (id=10) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.356][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=11) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "result": { "type": "string", "value": "complete" } } [1682355089.356][DEBUG]: DevTools WebSocket Command: Runtime.enable (id=12) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.365][DEBUG]: DevTools WebSocket Response: Runtime.enable (id=12) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { } [1682355089.366][DEBUG]: DevTools WebSocket Command: Runtime.evaluate (id=13) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "awaitPromise": true, "expression": "(function() { // Copyright 2012 The Chromium Authors\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n/*\n Enum for WebDriver status codes....", "returnByValue": true } [1682355089.373][DEBUG]: DevTools WebSocket Response: Runtime.evaluate (id=13) (session_id=0722589D24602E0CCC915C55C48CCBAB) E5A358E01CDB686F92CC0CF3CA5E7C21 { "result": { "type": "object", "value": { "status": 0, "value": 1 } } } [1682355089.373][INFO]: [f737cd04814becee00e6ddbc803efb52] RESPONSE InitSession { "capabilities": { "acceptInsecureCerts": false, "browserName": "chrome", "browserVersion": "112.0.5615.138", "chrome": { "chromedriverVersion": "112.0.5615.49 (bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936})", "userDataDir": "C:\Users\Vandana\AppData\Local\Temp\scoped_dir13856_77980912" }, "goog:chromeOptions": { "debuggerAddress": "localhost:62886" }, "networkConnectionEnabled": false, "pageLoadStrategy": "normal", "platformName": "windows", "proxy": { }, "setWindowRect": true, "strictFileInteractability": false, "timeouts": { "implicit": 0, "pageLoad": 300000, "script": 30000 }, "unhandledPromptBehavior": "dismiss and notify", "webauthn:extension:credBlob": true, "webauthn:extension:largeBlob": true, "webauthn:extension:minPinLength": true, "webauthn:extension:prf": true, "webauthn:virtualAuthenticators": true }, "sessionId": "f737cd04814becee00e6ddbc803efb52" } [1682355267.779][INFO]: [f737cd04814becee00e6ddbc803efb52] COMMAND QuitAll { } [1682355268.121][INFO]: [f737cd04814becee00e6ddbc803efb52] RESPONSE QuitAll [1682355268.121][DEBUG]: Log type 'driver' lost 0 entries on destruction [1682355268.121][DEBUG]: Log type 'browser' lost 0 entries on destruction 2023-04-24 22:24:28 FINE - Exception: newSession java.util.concurrent.TimeoutException Build info: version: '4.9.0', revision: 'd7057100a6' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6' Driver info: driver.version: ChromeDriver Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'LAPTOP-VRJ82T52', ip: '192.168.29.197' at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:561) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:229) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157) at org.openqa.selenium.chromium.ChromiumDriver.(ChromiumDriver.java:101) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:88) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:84) at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:63) at basic.Start.main(Start.java:34) Caused by: org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException Build info: version: '4.9.0', revision: 'd7057100a6' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6' Driver info: driver.version: ChromeDriver at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:65) at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42) at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56) at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:49) at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42) at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56) at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:99) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:112) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:94) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:165) at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:183) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543) ... 7 more Caused by: java.util.concurrent.TimeoutException at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1960) at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095) at org.asynchttpclient.netty.NettyResponseFuture.get(NettyResponseFuture.java:206) at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:59) ... 20 more

titusfortner commented 1 year ago

Huh, that's weird; it went from create straight to quit. Any chance you can try out Firefox and see if it works?

akm1967 commented 1 year ago

Sorry I went to sleep after 11 PM in India. When I use FireFox version 47.0.1 (Installed in my laptop). I am getting below message on the page: Not sure why it is pointing to http://3952/ Unable to connect Firefox can't establish a connection to the server at 3952. The site could be temporarily unavailable or too busy. Try again in a few moments. If you are unable to load any pages, check your computer's network connection. If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web. I checked my internet connection was fine and was able to connect to google.com.

Finally we got following errors: 2023-04-25 03:33:46 FINE - Executing: newSession [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {}}]}] 2023-04-25 03:36:47 FINE - Exception: newSession java.util.concurrent.TimeoutException Build info: version: '4.9.0', revision: 'd7057100a6' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6' Driver info: driver.version: FirefoxDriver Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'LAPTOP-VRJ82T52', ip: '192.168.29.197' at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:561) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:229) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:150) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:146) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:131) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:127) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:112) at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:102) at basic.Start.main(Start.java:36) Caused by: org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException Build info: version: '4.9.0', revision: 'd7057100a6' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6' Driver info: driver.version: FirefoxDriver at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:65) at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42) at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56) at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:49) at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42) at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56) at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:99) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:112) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:94) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:165) at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:183) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543) ... 9 more Caused by: java.util.concurrent.TimeoutException at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1960) at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095) at org.asynchttpclient.netty.NettyResponseFuture.get(NettyResponseFuture.java:206) at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:59) ... 22 more

akm1967 commented 1 year ago

Hi Titus, If you wish to investigate on my system further then please let me know we can setup a call and you can investigate. I am quite impressed with Selenium Manager 👍

akm1967 commented 1 year ago

I used following code: new SeleniumLogger().setLevel(Level.FINE); driver = new FirefoxDriver(); driver.manage().window().maximize(); driver.get("https://www.google.com");

akm1967 commented 1 year ago

When I used IE browser version 21H1 (OS Build 19043.1766): InternetExplorerDriver server (32-bit) 4.8.1.0 2023-04-25 04:04:41 FINE - Executing: newSession [null, newSession {capabilities=[Capabilities {browserName: internet explorer, se:ieOptions: {}}]}] Started InternetExplorerDriver server (32-bit) 4.8.1.0 Listening on port 26715 Only local connections are allowed 2023-04-25 04:07:44 FINE - Exception: newSession java.util.concurrent.TimeoutException Build info: version: '4.9.0', revision: 'd7057100a6' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6' Driver info: driver.version: InternetExplorerDriver Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Host info: host: 'LAPTOP-VRJ82T52', ip: '192.168.29.197' at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:561) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:229) at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:168) at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:155) at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:115) at basic.Start.main(Start.java:38) Caused by: org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException Build info: version: '4.9.0', revision: 'd7057100a6' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '17.0.6' Driver info: driver.version: InternetExplorerDriver at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:65) at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42) at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56) at org.openqa.selenium.remote.http.netty.NettyHttpHandler.execute(NettyHttpHandler.java:49) at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42) at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:56) at org.openqa.selenium.remote.http.netty.NettyClient.execute(NettyClient.java:99) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:112) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:94) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:68) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:165) at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:183) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543) ... 5 more Caused by: java.util.concurrent.TimeoutException at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1960) at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095) at org.asynchttpclient.netty.NettyResponseFuture.get(NettyResponseFuture.java:206) at org.openqa.selenium.remote.http.netty.NettyHttpHandler.makeCall(NettyHttpHandler.java:59) ... 18 more

titusfortner commented 1 year ago

Maybe a permissions issue? It's definitely something on your system and not a driver issue if everything is seeing the same error.

akm1967 commented 1 year ago

It's my personal laptop. There is no restrictions. Even tried running as admin still getting same issue.

diemol commented 1 year ago

If all browsers fail to launch it is definitely an issue with the laptop. Can you reproduce the same in another machine? There might be an issue with port allocation or a very restrictive firewall configuration. There is not much we can do about a machine configuration.

akm1967 commented 1 year ago

It Launches the browser but then fails. Please see below screenshot. LaunchIssue My other machine belongs to my work which has lot of restrictions and I can not install software on that. I will try to investigate from my side and will update you accordingly.

diemol commented 1 year ago

OK, we will leave this open for a while in case there is something for us to do.

akm1967 commented 1 year ago

Thanks and I will check from my side.

akm1967 commented 1 year ago

Hi Diego, On the same machine I run old project with old driver and was able to invoke browser successfully. So this can not be a security issue. Kindly check. Invoking Chrome driver Starting ChromeDriver 2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41) on port 45355 Only local connections are allowed. Apr 25, 2023 4:14:31 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end log4j:WARN No appenders could be found for logger (org.apache.http.client.protocol.RequestAddCookies). log4j:WARN Please initialize the log4j system properly. Apr 25, 2023 4:14:36 PM org.openqa.selenium.remote.ProtocolHandshake createSession INFO: Detected dialect: OSS Launched Chrome Driver 2 30

diemol commented 1 year ago

Then please provide a test script I can use to reproduce the issue with the latest versions. Please not that browser drivers have changed a lot and we cannot consider valid versions from several years ago.

akm1967 commented 1 year ago

New script which is not working: Start.zip Environment Details: Chrome Version 112.0.5615.138 (Official Build) (64-bit) Selenium Version - 4.9.0 Edition Windows 10 Home Single Language Version 21H1 Installed on ‎12-‎12-‎2020 OS build 19043.1766 Experience Windows Feature Experience Pack 120.2212.4180.0

akm1967 commented 1 year ago

My suspicion is on Browser & chromedriver mismatch. Question: Is selenium-chrome-driver-4.8.3.jar is playing role of chromedriver?

diemol commented 10 months ago

I cannot reproduce this with the latest Selenium (4.15.0), is this still happening?

titusfortner commented 9 months ago

Closing as we did not get additional information. Please follow up if there is still an issue with the latest version of Selenium.

github-actions[bot] commented 8 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.