{
  "Name": "CafeF-BCTC-PDF-Vietstock-filename",
  "CreationDate": "2025-8-12",
  "Commands": [
    {
      "Command": "echo",
      "Target": "--- Begin define filename report type ---",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "open",
      "Target": "https://finance.vietstock.vn/ALT/tai-tai-lieu.htm?doctype=1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "xpath=//*[@id=\"document-content\"]/div/div[2]/div[2]/p[2]/a@href",
      "Value": "filename1",
      "Description": "full link filename"
    },
    {
      "Command": "echo",
      "Target": "full link is ${filename1}",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "executeScript",
      "Target": "var myRe = /([^\\_]+)(?=\\.\\w+$)/;\nvar myArray = myRe.exec(${filename1}); return myArray",
      "Value": "filename2",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "Vietstock report type is ${filename2}",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "Congtyme congtyme hopnhat Hopnhat",
      "Value": "rptype",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "verifyElementPresent // xpath=//*[@id=\"document-content\"]/div/div[2]/div[2]/p[2]/a[contains(@href,'congtyme')]",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "if",
      "Target": "${rptype}.lastIndexOf(${filename2}) >-1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "M",
      "Value": "filename3",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "verifyElementPresent // xpath=//*[@id=\"document-content\"]/div/div[2]/div[2]/p[2]/a[contains(@href,'hopnhat')]",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "if",
      "Target": "${rptype}.lastIndexOf(${filename2}) > -1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "HN",
      "Value": "filename3",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "CafeF report type is ${filename3}",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "--- Finish define filename report type ---",
      "Value": "green",
      "Description": ""
    }
  ]
}