Search code examples
capybarafirefox-marionette

Capybara setting a field results in 'Attempt to set readonly element with value'


With Firefox 47.0, I switched to the Marionette driver. Using Capybara, when I try to fill in a field, Capybara responds with 'Attempt to set readonly element with value' and doesn't set the field value. Querying the readonly flag gives a 'false', so what's wrong?

find_by_id('account_username').set(@username)
Attempt to set readonly element with value: test-1466414209-898496
*This will raise an exception in a future version of Capybara

find_by_id('account_username')['readonly']
=> "false"

Using Capybara 2.7.1 and geckodriver 0.8.0 on OSX.

Hope this is the right place to ask. Thanks in advance!


Solution

  • As explained in this issue, you need to be using the marionette branch of Capybara for that to work. Marionette support between geckodriver and selenium is not yet fully working, and not a fully functional replacement for firefoxdriver. For now, you're better off reverting to Firefox 46 or waiting for the Firefox 47.0.1 release as mentioned in this issue github.com/jnicklas/capybara/issues/1709