Information:

Environment

  • Dynatrace Recorder
Symptoms

In some websites, hidden fields are used to pass along information to forms. If the hidden fields are not filled out properly when the test runs, the test may fail.

Solution

Normally a hidden field is filled by a browser when the associated explicit page elements are filled in by a user. To find out the right value for a hidden field, do the following:

  1. Enable Firebug when accessing a website.
  2. Find out the suspicious hidden fields.
  3. Fill in the relevant elements in the page with the information that is required.
  4. Get the value of the hidden fields that are generated automatically in Firebug.
For example:

Before the relevant page element is filled, hidden fields may be something like below:
<input id="modelSelected" type="hidden" name="modelSelected">
<input id="regDtCoverType" type="hidden" name="regDtCoverType">

After the relevant element is filled, you can see the value of the hidden fields in Firebug:
<input id="modelSelected" type="hidden" name="modelSelected" value="206">
<input id="regDtCoverType" type="hidden" name="regDtCoverType" value="COMPREHENSIVE,THIRD PARTY">

Then, you can add a custom action to the script right after the action that filled the information. The code snippet is as follows (assuming the target window is gomez_top[0] — you can add custom code to select the target window):

document.getElementById("modelSelected").value="206";
document.getElementById("modelSelected").value="COMPREHENSIVE,THIRD PARTY"

 

 

 

 

  • No labels