Skip to content

[🐛 Bug]: Not able to open the devtools session twice in ruby selenium #14350

Closed
@Mohanram3012

Description

@Mohanram3012

What happened?

The dev tools session is opened and i'm using it for intercepting the network request and response . I'm using ruby selenium for the above . After intercepting the driver is stuck since we are capturing the request and responses. To get the value of the intercepted request we need to close the dev tools session . We tried several ways and finally driver.devtools.close is closing the session and i'm able to move further . But with the same driver instance when i try to reopen the dev tools session i'm getting IO connection closed error . Need to reopen the dev tools session

How can we reproduce the issue?

driver.intercept do |request, &continue|
            @intercepted_logs << {request: {
             method: request.method,
             url: request.url,
             post_data: request.post_data,
             headers: request.headers
           }}
           continue.call(request)
        end
        // some code 
       driver.devtools.close
       // trying to reopen the connection with the same driver
       driver.intercept

Relevant log output

IOError: closed stream
from /Users/mok/.rvm/gems/ruby-3.2.2@rubyupgrade/gems/selenium-webdriver-4.10.0/lib/selenium/webdriver/common/websocket_connection.rb:61:in `write'

Operating System

Macos

Selenium version

Selenium 4.10 seleniumdevtools 0.126

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

Chrome 126

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

chromedriver 126.0

Are you using Selenium Grid?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-rbRuby BindingsI-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions