Skip to content

[🐛 Bug]: [rb] BiDi page loads longer than 30 seconds raise Selenium::WebDriver::Error::TimeoutError #15620

Open
@palmermbandy

Description

@palmermbandy

Description

I have an existing test suite where we have not enabled BiDi yet. Some pages take longer than 30 seconds to load, and it works fine with WebDriver Classic. But when I enable BiDi and visit a page that takes longer than 30 seconds, I get a Selenium::WebDriver::Error::TimeoutError that causes my test to fail, but the page is still in the process of loading. I could rescue and handle this in my test, but it would be preferable not to have to do that. Is a 30 second websocket response timeout expected to interrupt navigation events that take longer than this?

/Users/palmerbandy/.asdf/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.31.0/lib/selenium/webdriver/common/wait.rb:73:in `until': timed out after 30 seconds (Selenium::WebDriver::Error::TimeoutError)
from /Users/palmerbandy/.asdf/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.31.0/lib/selenium/webdriver/common/websocket_connection.rb:75:in `send_cmd'
from /Users/palmerbandy/.asdf/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.31.0/lib/selenium/webdriver/bidi.rb:60:in `send_cmd'
from /Users/palmerbandy/.asdf/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.31.0/lib/selenium/webdriver/bidi/browsing_context.rb:49:in `navigate'
from /Users/palmerbandy/.asdf/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.31.0/lib/selenium/webdriver/remote/bidi_bridge.rb:33:in `get'
from /Users/palmerbandy/.asdf/installs/ruby/3.2.4/lib/ruby/gems/3.2.0/gems/selenium-webdriver-4.31.0/lib/selenium/webdriver/common/navigation.rb:32:in `to'

Reproducible Code

# Start up a local slow server (https://gist.github.com/kainam00/39c8d5876027e38f112d6f07c785bb56?permalink_comment_id=4210916#gistcomment-4210916)
# with a 31 second response time: python slowserver.py -d 31 -p 8000

# In an IRB session
require 'selenium-webdriver'
Selenium::WebDriver.logger.level = :debug
options = Selenium::WebDriver::Options.chrome(web_socket_url: true)

page = Selenium::WebDriver.for(:chrome, options: options)
page.navigate.to('http://localhost:8000/slow')

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-rbRuby BindingsD-chromeI-defectSomething is not working as intendedOS-macR-help wantedIssues looking for contributions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions