Enter Case number reference for associated cases.

Case #


Type: APM as a Service

Old Article ID: 2626

Old Article Type: howto



Detail the contextual information specific to the issue; i.e. Product, Version, Agent, System, etc.

  • IE Agent
  • FF Agent
  • Dynatrace Recorder

Describe the problem, from the user perspective

  • Skip a step within a script based on a conditional statement. For example:
    • Security Questions
    • Error Pages

Clearly list the Steps to resolve the issue

Create a Custom action in the "control" target window, using  a modified version of the code below.

Note that the steps and actions are arrays. Each element in that array will start at 0. Step 1 will look like script.steps[0].


var loc = new Locator({'targetWindow':'gomez_top[0]',locators:[['dom', 'document.documentElement']]});
var element= loc.execute();
if (element.innerHTML.indexOf('Security Questions') == -1){
script.steps[5].actions[1].type ='do_not_execute';
script.steps[5].actions[2].type ='do_not_execute';
script.steps[5].actions[3].type ='do_not_execute';

Pseudo Code

If the base page does not have the text Security Questions

Do not execute Action 2 of Step 6

Do not execute Action 3 of Step 6

Do not execute Action 4 of Step 6


Also see Scripting Conditional Pages in the documentation.