{
  "name": "Robot Framework Example",
  "nodes": [
    {
      "parameters": {},
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        -20,
        0
      ],
      "id": "376d5b6f-420d-4670-9fb0-d32a21bc446d",
      "name": "When clicking \u2018Test workflow\u2019"
    },
    {
      "parameters": {
        "robotScript": "*** Settings ***\nLibrary    Browser\n\n*** Variables ***\n${USER_AGENT}    Mozilla/5.0 (X11; Debian; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6330.194 Safari/537.36\n${URL}             https://practice.expandtesting.com/login\n${USERNAME}        practice\n${PASSWORD}        SuperSecretPassword!\n\n*** Tasks ***\nLogin\n    Register Keyword To Run On Failure    Take Screenshot    EMBED\n    New Browser    headless=True\n    New Context    userAgent=${USER_AGENT}\n    New Page    ${URL}\n    Wait For Elements State    css=div.fc-consent-root    hidden    timeout=5s\n    Type Text    id=username    ${USERNAME}\n    Type Secret    id=password    $PASSWORD\n    Take Screenshot    EMBED    fullPage=True\n    Click    xpath=//button[@type=\"submit\" and contains(text(), \"Login\")]\n    ${current_url} =    Get Url\n    ${state_file} =    Save Storage State\n    Close Browser\n    Log    ${current_url}\n    Log    ${state_file}",
        "includeLogHtml": true
      },
      "type": "n8n-nodes-robotframework.robotFramework",
      "typeVersion": 1,
      "position": [
        260,
        0
      ],
      "id": "9295bb64-47d1-48be-b397-1b3f49d2836c",
      "name": "Login"
    },
    {
      "parameters": {
        "robotScript": "=*** Settings ***\nLibrary    Browser\n\n*** Variables ***\n${URL}    {{ $json.current_url }}\n\n*** Tasks ***\nValidate Login\n    Register Keyword To Run On Failure    Take Screenshot    EMBED\n    New Browser    headless=True\n    New context    storageState={{ $json.state_file }}\n    New Page    ${URL}\n    Get Text    xpath=//h1[text()=\"Secure Area page for Automation Testing Practice\"]\n    ${screenshot_path}=    Take Screenshot    return_as=path_string    fullPage=True\n    Close Browser\n    Log    ${screenshot_path}",
        "includeLogHtml": true
      },
      "type": "n8n-nodes-robotframework.robotFramework",
      "typeVersion": 1,
      "position": [
        540,
        0
      ],
      "id": "73460ec3-74d3-4252-b3c9-c844969e9254",
      "name": "Validate Login"
    },
    {
      "parameters": {
        "fileSelector": "={{ $json.screenshot_path }}",
        "options": {
          "fileName": "screenshot.png",
          "dataPropertyName": "screenshot"
        }
      },
      "type": "n8n-nodes-base.readWriteFile",
      "typeVersion": 1,
      "position": [
        820,
        0
      ],
      "id": "178677a8-1fc9-4ca5-8320-690eb371ff6f",
      "name": "Read Screenshot from Disk"
    },
    {
      "parameters": {
        "operation": "sendPhoto",
        "binaryData": true,
        "binaryPropertyName": "=screenshot",
        "additionalFields": {
          "caption": "Login was successful",
          "disable_notification": false,
          "parse_mode": "HTML"
        }
      },
      "id": "ff7a47aa-ad62-4d47-8b67-8e4e01d13b71",
      "name": "Post",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1100,
        0
      ],
      "retryOnFail": true,
      "maxTries": 3,
      "waitBetweenTries": 5000,
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "When clicking \u2018Test workflow\u2019": {
      "main": [
        [
          {
            "node": "Login",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Login": {
      "main": [
        [
          {
            "node": "Validate Login",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Validate Login": {
      "main": [
        [
          {
            "node": "Read Screenshot from Disk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Screenshot from Disk": {
      "main": [
        [
          {
            "node": "Post",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Post": {
      "main": [
        []
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "757b891e-5763-41cd-9fb9-5b7dcc7f289d",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "id": "Nuo3lvIklRUH0dyU",
  "tags": [
    {
      "createdAt": "2024-12-12T22:21:03.178Z",
      "updatedAt": "2024-12-12T22:21:03.178Z",
      "id": "gfwMcOmJ6mSNn5cV",
      "name": "Misc"
    },
    {
      "createdAt": "2025-01-31T15:10:12.510Z",
      "updatedAt": "2025-01-31T15:10:12.510Z",
      "id": "sdcUqSATlDOzqv3Q",
      "name": "Robot Framework"
    }
  ]
}