Web51.5
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:

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)
node.getAttribute('value')
        
Example 51.37:  Accessing the value attribute of a hidden field