Didacticials

  • To begin
  • Make Automations [comming soon]
  • Make Didacticials or Presentations [comming soon]

Instructions

  • goTo
  • click
  • wait
  • message
  • for
  • alert
  • ifexists / ifnotexists
  • whileExists
  • audio
  • exit

Links

  • Download Zenith
  • jQuery's Selectors

About Zenith

  • Credits and Thanks
  • Binairies Sources

for

Description

Browses each element in a group of elements specified by a selector.

In the sub-instructions, the current element is specified by the variable given at "for"

Syntax

Needed pairs :

  • "for" : "$your_variable"
  • "in" : "selector"
  • "do" : [Sub-instructions]

options that can be added :

  • "reverse"
  • "reload"

Additionnal explanation

Details about the arguments :

  • option "reverse" : browses from the last element to the first one, instead of from the first one to the last one
  • option "reload" : reload the group of elements before executing the sub-instructions. Usefull when you have to leave or to reload the current page. Avoid to use it if it is not required to optimize your script.

Example

This Example will click on all links on the left menu, and go back to this page


{
   "debug":true,
   "do":[
{"for":"$a",
  "in":"#left_menu a[href^='/']",
  "options":"reload reverse",
  "do":[
{"goTo":"$a"},
{"click":"l"},
{"wait":"while loading"},
  ]
},
{"goTo":"#left_menu a[href$='for.php']"}, {"click":"l"}, {"wait":"while loading"},    ],
}

    

© 2009 the Zenith Team.