Stop macro execution command if string is found on website

In setting “if error happens in loop” -> continue next loop
Is there any command to stop loop if condition met in line 4 And will not go to next loop?

As far as I understand it, the “In setting “if error happens in loop” → continue next loop” setting is for those cases when you want to have a macro run forever, no matter what happens. This is useful for example for stress testing websites.

Is there any command to stop loop if condition met in line 4 And will not go to next loop?

For more complicated workflows I would not use the LOOP button. Instead create macro internal loops with one of these flow control commands:


Actually I want to search the text “Medical center information” in the website. When I found it I don’t need to run macro. So I want loop will not be continue and stop automatically. Please help me about my issue.

In general the check for a substring inside text in Javascript is ${textstring}.includes("abc") == true, and you can use this in IF, WHILE or REPEATIF.

Here is an example. It checks the website until the string “5” shows up at the last digit of the time.

{
  "Name": "checkstring",
  "CreationDate": "2020-3-5",
  "Commands": [

    {
      "Command": "open",
      "Target": "https://www.clocktab.com/",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "medium",
      "Value": "!replayspeed"
    },
    {
      "Command": "do",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "comment",
      "Target": "Extract second digit and check for string",
      "Value": "t"
    },
    {
      "Command": "storeText",
      "Target": "id=digit2",
      "Value": "t"
    },
    {
      "Command": "echo",
      "Target": "Extracted digit is t=${t}",
      "Value": "blue"
    },
    {
      "Command": "repeatIf",
      "Target": "${t}.includes(\"5\") == false",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "YES, the 5 digit is shown",
      "Value": "green"
    }
  ]
}
2 Likes

Nice example, I made a screencast for it: