Accessing hidden fields on a web page

Hidden fields are not captured by default and therefore not stored under the 'Windows and components' node.

In case you frequently need to access hidden fields you can deactivate the Take visibility of DOM nodes into account option.

Another way to get hidden fields recorded is the following:

  • Activate the record components mode.
  • Navigate the mouse cursor to the parent item containing the hidden field (most likely a FORM element).
  • Press right mouse button and select »Component and children« from the popup menu.
  • Deactivate the record components mode.
  • A search within 'Windows and components' for e.g. 'HIDDEN' should get you to your destination component quickly.

To access a hidden field's attributes (e.g. the 'value' attribute) you can create a simple 'SUT script' as shown below. Details on scripting in general, the used methods and parameters can be found in Scripting, Run context API and Pseudo DOM API respectively.

node = rc.getComponent('id of the hidden component', hidden=1)
Example 49.35:  Accessing the value attribute of a hidden field