Vaccination automation Saarland

Hello wonderfull ui.Vision Team,

this request is similar to How to automate scheduling my coronavirus vaccine shot appointment?

but slightly different, as we are talking about another Website to book our vaccination appointments:

impfen-saarland.de/

We want to use the option to book appointments which have recently been canceled by others:
image

We have automated the steps to travel through our available Vaccination-Centres and give us a 2s Pause to stop the script in case there is a appointment available. Unfortunately doing the process manually from there is way to slow as it the appointments are always gone already.

We know we need a if/else funtionality to either go back, if no appointments are availabe, which is already the case in the current script after the 2s pause or to select randomly an appointment from the list an click “weiter” (next) if there is an appointment available. Ideally then also warn the user with a sound in case the list is shown, so that the user knows, the script may have fetched an appointment and in the next step his action may be needed (we do not know how the next step exactly looks).

We managed to get a screenshot of the List of appointments, but I have no clue how to correctly set up the if/else funtionality to get the desired outcome described above.

May I kindly ask for your support ? PS: We would like to share this tool with all so that everyone has the same chances again, without having to sit in front of the computer all day long.

Screenshot from the Page showing the time slots available. The “weiter” (next) Button is below:

Script to travel the Vaccination Centres with 2s Pause to see if a List is shown:

    {
  "Name": "Impfen Alle Zentren",
  "CreationDate": "2021-5-11",
  "Commands": [
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
        "xpath=//div[2]/div/button",
        "css=#logged-in-area > div > div.flex-layout > div.SelectList-bp36o1-0.jhxYky > button:nth-child(1)"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/button[2]",
        "css=#logged-in-area > div > div.flex-layout > div.ButtonRow-sc-105da72-0.bYWBrs > button.Button-sc-14zetp2-0.Button__PrimaryButton-sc-14zetp2-1.gDRmPW.bqlAHR"
      ],
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/div/button",
        "css=#logged-in-area > div > div.flex-layout > div > button"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button[2]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button[2]",
        "xpath=//div[2]/div/button[2]",
        "css=#logged-in-area > div > div.flex-layout > div.SelectList-bp36o1-0.jhxYky > button:nth-child(2)"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/button[2]",
        "css=#logged-in-area > div > div.flex-layout > div.ButtonRow-sc-105da72-0.bYWBrs > button.Button-sc-14zetp2-0.Button__PrimaryButton-sc-14zetp2-1.gDRmPW.bqlAHR"
      ],
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/div/button",
        "css=#logged-in-area > div > div.flex-layout > div > button"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button[3]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button[3]",
        "xpath=//button[3]",
        "css=#logged-in-area > div > div.flex-layout > div.SelectList-bp36o1-0.jhxYky > button:nth-child(3)"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/button[2]",
        "css=#logged-in-area > div > div.flex-layout > div.ButtonRow-sc-105da72-0.bYWBrs > button.Button-sc-14zetp2-0.Button__PrimaryButton-sc-14zetp2-1.gDRmPW.bqlAHR"
      ],
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/div/button",
        "css=#logged-in-area > div > div.flex-layout > div > button"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button[4]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button[4]",
        "xpath=//button[4]",
        "css=#logged-in-area > div > div.flex-layout > div.SelectList-bp36o1-0.jhxYky > button:nth-child(4)"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/button[2]",
        "css=#logged-in-area > div > div.flex-layout > div.ButtonRow-sc-105da72-0.bYWBrs > button.Button-sc-14zetp2-0.Button__PrimaryButton-sc-14zetp2-1.gDRmPW.bqlAHR"
      ],
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/div/button",
        "css=#logged-in-area > div > div.flex-layout > div > button"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button[5]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button[5]",
        "xpath=//button[5]",
        "css=#logged-in-area > div > div.flex-layout > div.SelectList-bp36o1-0.jhxYky > button:nth-child(5)"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div[2]/button[2]",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/button[2]",
        "css=#logged-in-area > div > div.flex-layout > div.ButtonRow-sc-105da72-0.bYWBrs > button.Button-sc-14zetp2-0.Button__PrimaryButton-sc-14zetp2-1.gDRmPW.bqlAHR"
      ],
      "Description": ""
    },
    {
      "Command": "pause",
      "Target": "2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"logged-in-area\"]/div/div[2]/div/button",
        "xpath=//button[@type='submit']",
        "xpath=//div[2]/div/button",
        "css=#logged-in-area > div > div.flex-layout > div > button"
      ],
      "Description": ""
    }
  ]
}

Ideally then also warn the user with a sound

See here how to play a sound

or to select randomly an appointment from the list an click “weiter” (next) if there is an appointment available.

Ah, so the problem is that you can not record the next steps, since they rarely happen :wink:

I would suggest you do it this way:

  • Check in a loop if there is a “No appointment available” message shown on the screen

  • And if not, then play the alarm sound

Here is a related forum post for this:

or to select randomly an appointment from the list an click “weiter” (next) if there is an appointment available

That should be very easy to do once you are at this step. Or do you have a specfic question about this?

Since you have a screenshot of the next screen, you can also try to create the next steps already using the visual XClick command.