How to fill hidden field with Capybara?

You need to locate the hidden field and set its value. There are a couple ways, this is probably the simplest

find(:xpath, "//input[@id='my_hidden_field_id']").set "my value"

If you’re executing a client_side script in production, you could just tell capybara to run it with a javascript-compliant driver

page.execute_script("$('hidden_field_id').my_function()")

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)