test case for hidden field is not working with cuc

2019-04-02 23:29发布

问题:

fill_in "user_role", :with => @visitor[:role]

This is checking simple input field but input field with hidden it is not working for that is there any other method for hidden field.

回答1:

hidden_field = find :xpath, "//input[@id='id_of_hidden_field']"
hidden_field.set "hello world"