Skip to content

RemoteWebDriver cannot be cast to HasDevTools #9803

@boris779

Description

@boris779

🐛 Bug Report

It's not possible to use the DevTools with the RemoteDriver. I was told to use the HasDevTools Interface but it still not working when using a RemoteWebDriver (with a Grid)

java.lang.ClassCastException: class org.openqa.selenium.remote.RemoteWebDriver cannot be cast to class org.openqa.selenium.devtools.HasDevTools (org.openqa.selenium.remote.RemoteWebDriver and org.openqa.selenium.devtools.HasDevTools are in unnamed module of loader 'app')

Detailed steps to reproduce the behavior:

webDriver is RemoteWebDriver which is used in a SeleniumGrid Environment.

Java:
DevTools devTools = ((HasDevTools) webDriver).getDevTools();

Kotlin:
val devTools: DevTools = (webDriver as HasDevTools).devTools

Used Selenium Version: 4.0.0-rc-1 (also tested with beta-3 and beta-4)

Environment

OS: Ubuntu 21
Browser: Chrome
Browser version: > 87
Browser Driver version: >87
Language Bindings version: Java

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-javaJava Bindings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions