-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network conditions cannot modified for remote chrome browser with capybara #7174
Labels
Comments
Switching to
|
nikriek
changed the title
Network conditions cannot modified for remote chrome browser in Rails
Network conditions cannot modified for remote chrome browser with capybara
May 6, 2019
To prove my point I patched the paths. This makes it work: module Selenium
module WebDriver
module Chrome
module Bridge
PATCHED_COMMANDS = {
get_network_conditions: [:get, 'session/:session_id/chromium/network_conditions'],
set_network_conditions: [:post, 'session/:session_id/chromium/network_conditions'],
send_command: [:post, 'session/:session_id/goog/cdp/execute']
}.freeze
def commands(command)
PATCHED_COMMANDS[command] || super
end
end
end
end
end |
Thank you for a great bug report and a provided fix. I've committed and it will be released in the next 4.0 alpha. |
twalpole
pushed a commit
that referenced
this issue
May 7, 2019
This is also released in 3.142.2. |
SecorD0
pushed a commit
to SecorD0/selenium
that referenced
this issue
Dec 2, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
🐛 Bug Report
We use a combination of docker-compose, rails and selenium to perform integration/system testing. The Capybara/rspec environment is supposed to send commands to a remote chrome container:
This is how we setup the driver:
This setup works completely fine. Capybara connects to the hub and successfully runs our integration tests.
In order to enhance our tests, we need to make use of the
network_conditions
selenium endpoint to test the application in an offline setup. This seems not to be officially documented, but it can be achieved using this call:Instead of returning a success, the call throws an exception:
To Reproduce
You can reproduce the issue by using a custom remote host in the Rails application.
Expected behavior
The expected behavior is a successful call for
The call expects a json response from
POST http://<HOST>:4444/wd/hub/session/e1fa22b0aaac7e5207d7bbe497673f57/chromium/network_conditions
I suspect the issue to be a problem of absolute and relative url paths in the chrome bride: https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/chrome/bridge.rb#L27
Other calls to the api (like for creating a new session) do not have a
/
appended. It seems that the call is going toPOST http://<HOST>:4444/session/e1fa22b0aaac7e5207d7bbe497673f57/chromium/network_conditions
Test script or set of commands reproducing this issue
See above
Environment
OS: Linux 4.9.125-linuxkit / Docker
Browser: chrome
Browser version: chromedriver=74.0.3729.6
Browser Driver version:
Language Bindings version: Ruby 2.5.2
The text was updated successfully, but these errors were encountered: