thoughtbot/capybara-webkit — Issue #209: Manipulating multiselects with Javascript fails
Author: rustygeldmacher
Created: 2011-11-08 21:41:41+00:00
State: open

When you have a select with "multiple" enabled, and a script on the page manipulates the selected elements, the changes will not get reflected in a subsequent query through the driver.

I made a quick example of this behavior, based on the driver specs from capybara-webkit. The repo is here: https://github.com/rustygeldmacher/capybara-webkit-forms-with-js

The last spec fails -- it calls a script on the page that clears the selected elements, then queries the value of the select again, but the values are still all selected as far as capybara-webkit is concerned.

Any help/advice is appreciated -- for all I know this is expected behavior :)