How to repeat an action for every div with an specific class?

For future reference, this is how we addressed the use case:

{items=
  map(
    {site: html; 
      xpath=//*[contains(concat(' ', @class, ' '), ' parentClass ')][.//span[contains(@id, 'condition1')] or .//span[contains(@id, 'condition2')]];
      multiple=yes},
  x->extractregex(x, "id=\"(.+?)\""))}
{repeat: for item in items}
{sel="#" & item & " #checkbox input"}
{click: selector={=sel}}{wait: delay=0.5s}{endrepeat}

We used the newly launched dynamic click CSS selector in this as well! The flow is:

  1. Use the {site} command to grab each element on the page such that it has a child in its subtree that matches the given condition. {site} with multiple=yes grabs all elements as a list.
  2. Use the map function to extract the unique 'id' of each such element, by using extractregex.
  3. We then repeat through the list.
  4. On each iteration, we build the selector for the checkbox input by string concatenation. Note this selector is dynamically generated on each repeat iteration.
  5. Then we {click} on the dynamic selector.