Fix few more flaky ruby tests by asolntsev · Pull Request #16695 · SeleniumHQ/selenium

Wait until the page gets loaded and the element ges rendered.

Example of failure:

```ruby
Selenium::WebDriver::Element raises if different element receives click
     Failure/Error: expect { driver.find_element(id: 'contents').click }.to raise_error(Error::ElementClickInterceptedError)

       expected Selenium::WebDriver::Error::ElementClickInterceptedError, got #<Selenium::WebDriver::Error::NoSuchElementError:"no such element: Unable to locate element: {\"metho...it: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#nosuchelementexception"> with backtrace:
         # ./rb/lib/selenium/webdriver/remote/response.rb:63:in `add_cause'
         # ./rb/lib/selenium/webdriver/remote/response.rb:41:in `error'
         # ./rb/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok'
         # ./rb/lib/selenium/webdriver/remote/response.rb:34:in `initialize'
         # ./rb/lib/selenium/webdriver/remote/http/common.rb:103:in `new'
         # ./rb/lib/selenium/webdriver/remote/http/common.rb:103:in `create_response'
         # ./rb/lib/selenium/webdriver/remote/http/default.rb:103:in `request'
         # ./rb/lib/selenium/webdriver/remote/http/common.rb:68:in `call'
         # ./rb/lib/selenium/webdriver/remote/bridge.rb:625:in `execute'
         # ./rb/lib/selenium/webdriver/remote/bridge.rb:493:in `find_element_by'
         # ./rb/lib/selenium/webdriver/common/search_context.rb:71:in `find_element'
         # ./rb/spec/integration/selenium/webdriver/element_spec.rb:34:in `block (3 levels) in <module:WebDriver>'
         # ./rb/spec/integration/selenium/webdriver/element_spec.rb:34:in `block (2 levels) in <module:WebDriver>'
     # ./rb/spec/integration/selenium/webdriver/element_spec.rb:34:in `block (2 levels) in <module:WebDriver>'
```

See https://github.com/SeleniumHQ/selenium/actions/runs/19987626355/job/57324241360?pr=13739 for example.
instead of sleeping for 0.5s, just wait for the needed URL.

NB! The previous helper method `wait_for_new_url(old_url)` caused flaky tests because in Firefox, browsers changes URLs like this: "<old url>" -> "about:blank" -> "<new url>".
instead of sleeping for 2.5s, just wait for the needed logs.

@asolntsev

This was referenced

Jan 19, 2026

This was referenced

Jan 19, 2026

This was referenced

Feb 1, 2026

This was referenced

Feb 11, 2026

This was referenced

Feb 20, 2026