I’m working on automating up a client’s AJAXy application right now and managed to get myself very
confused frustrated yesterday over retrieving a value that was updated through a JS event.
Because the field that gets updated is an input one, the content of it is stored in the value attribute.
This is a RoR application, so I’m using the selenium-client gem. To get an attribute named ‘value’ using it you would do the following.
So how do you get the updated value? Well, after an embarrassing length of time the magic is to use the get_value method.
Now, in theory they should do the same darn thing. Reality is different. Yesterday evening would seem to imply that get_attribute works on the most recently updated html retrieved from the server whereas get_value works directly on the DOM.