Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Chromedriver unable to fill time fields after navigating to "about:blank" #1355

Closed
wants to merge 1 commit into from

2 participants

@mikeraimondi

I don't fully understand this issue, so this PR is more about putting eyeballs on the problem than proposing a good solution. /disclaimer

Capybara has an issue when filling time fields in Chrome. When using Chromedriver only, calling navigate.to("about:blank") causes all subsequent attempts to fill inputs with type=time to silently fail.

I've set up a Rails repo that illustrates the problem. Clone, bundle, and run bundle exec rspec spec/features. I would have added a test to Capybara, but I couldn't figure out how to execute the test suite in Chrome instead of FF.

The quick fix that I've implemented for my project is the subject of this PR. For reasons I cannot discern, calling JavaScript to load "about:blank" appears not to trigger the bug. Hopefully someone else can dig around and discover the real cause for this issue so a proper solution can be implemented.

@abotalov
Collaborator

As it is reproducible in Chromedriver only it looks like a bug in Chromedriver to me. Please try to file a bug against this project.

Note that to file a bug against Chromedriver you should lower signaficantly number of dependencies (no Rails, PG, etc.) and use Selenium Webdriver ruby binding directly instead of Capybara.

@mikeraimondi

Fair enough. I'm not sure I have enough time right now to track down the bug in Chromedriver, but at least now there's a record that this bug exists. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 7, 2014
  1. @mikeraimondi
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/capybara/selenium/driver.rb
View
4 lib/capybara/selenium/driver.rb
@@ -98,7 +98,9 @@ def reset!
# to about:blank, so we rescue this error and do nothing
# instead.
end
- @browser.navigate.to("about:blank")
+ @browser.execute_script %Q{
+ window.location = "about:blank";
+ }
rescue Selenium::WebDriver::Error::UnhandledAlertError
# This error is thrown if an unhandled alert is on the page
# Firefox appears to automatically dismiss this alert, chrome does not
Something went wrong with that request. Please try again.