Simple search and click

Im trying to make it

  1. Click a search button on the website
  2. search for a text
  3. if it finds the text then click a button
  4. if not then restart

i just cant make it work

this is what i got

{
“Name”: “test”,
“CreationDate”: “2024-5-15”,
“Commands”: [
{
“Command”: “store”,
“Target”: “0”,
“Value”: “!TIMEOUT_WAIT”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorignore”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “id=exam-search-button”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “sourceSearch”,
“Target”: “11-07-2024”,
“Value”: “a1”,
“Description”: “”
},
{
“Command”: “if”,
“Target”: “${a1} >= 0”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “gotoLabel”,
“Target”: “slut”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “else”,
“Target”: “”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “times”,
“Target”: “${a1}”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “click”,
“Target”: “xpath=//*[@id="exam-times-container"]/div/div/div[2]/div/div/span/button”,
“Value”: “a5”,
“Description”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “end”,
“Target”: “”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “label”,
“Target”: “slut”,
“Value”: “”,
“Description”: “”
}
]
}