Information:

Environment

  • IE Agent
  • FF Agent
  • Gomez Recorder
Symptoms

  • Skips step within a script based on a conditional statement
  • Example:
    • Security Questions
    • Error Pages
Solution

  • Create a custom action in the "control" target window
  • Use a modified version of the code below:
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
  • Make note that the steps and actions are arrays. So each element in that array will start at 0. Step 1 will look like script.steps[0]
  • Example script attached will search Bing for the text "droid". If any results contain the text "iPhone", it will then search for "iPhone"

 

Root Cause

 

Icon

Error rendering macro 'kbsurvey' : null

  • No labels