Can not fill in hidden input field

778 views
Skip to first unread message

Sean Dunagan

unread,
Sep 27, 2011, 12:44:30 PM9/27/11
to be...@googlegroups.com

I have a hidden input field in a form like the one shown below:

                <input id="hidden_input" type="hidden" name="hidden_input" value="0" />

 

In one of my php step functions, I want to set this input field to be "1". I am using the command below:

                $steps->And('I fill in "1" for "hidden_input"', $world);

 

However, I am getting the following error message from this line:

 

                Form field with id|name|label|value "hidden_input" not found

 

I have also tried using

               

                $steps->And('I fill in "hidden_input" with "1"', $world);

 

But that returns the same error.

 

However, when I change the input to be type="text" the field is found and changed accordingly.  Setting the type to text is the ONLY change I made to the field.

 

Is there some sort of special syntax for selecting hidden input fields, or is this functionality simply unavailable for hidden input fields?

 

Thank you in advance for your time.

 

Sean Dunagan

Konstantin Kudryashov

unread,
Oct 3, 2011, 7:08:44 AM10/3/11
to be...@googlegroups.com
It's intended by design. Mink is user+browser emulator. It emulates everything, that real user can do in real browser. And user surely can't fill hidden fields on the page - he just don't see it.

Mink is not crawler, it's browser emulator. The whole idea of Mink is to describe real user interactions through simple and clean API. If there's something, that user can't do through real browser - you can't do it with Mink.

Konstantin Kudryashov

unread,
Oct 3, 2011, 7:22:32 AM10/3/11
to be...@googlegroups.com
The idea of Mink is to describe observable by user browser interactions. And if you're trying to test something unobservable by user - Mink just telling you that you're doing something wrong by not supporting those actions ;-) That's the idea.
Reply all
Reply to author
Forward
0 new messages