{
  "Name": "CafeF-BCTC-PDF-Vietstock-filename",
  "CreationDate": "2025-8-14",
  "Commands": [
    {
      "Command": "echo",
      "Target": "--- Begin define filename report type ---",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "nodisplay",
      "Value": "!replayspeed",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "true",
      "Value": "!ErrorIgnore",
      "Description": ""
    },
    {
      "Command": "csvRead",
      "Target": "${!COL1}-${!COL2}-${!COL5}-Vietstock-BCTC-count.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "${!CSVReadMaxRow}",
      "Value": "time2",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${!COL1} has ${time2} report(s)",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "times",
      "Target": "${time2}",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "store // ${!times}",
      "Value": "!csvReadLineNumber",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "csvRead // ${!COL1}-${!COL2}-${!COL5}-BCTC.csv",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "open // https://finance.vietstock.vn/{!COL1}/tai-tai-lieu.htm?doctype=1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "comment",
      "Target": "pause // 2000",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "storeAttribute",
      "Target": "xpath=//*[@id=\"document-content\"]/div/div[2]/div[2]/p[${!times}]/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": "if",
      "Target": "${rptype}.lastIndexOf(${filename2}) >-1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "M",
      "Value": "filename3",
      "Description": ""
    },
    {
      "Command": "elseif",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "if",
      "Target": "${rptype}.lastIndexOf(${filename2}) >-1",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "store",
      "Target": "HN",
      "Value": "filename3",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "end",
      "Target": "",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "CafeF report type is ${filename3}",
      "Value": "green",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"document-content\"]/div/div[2]/div[2]/p[${!times}]/a",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "run",
      "Target": "CafeF-BCTC-PDF-Vietstock-download",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "--- Finish define filename report type ---",
      "Value": "green",
      "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": ""
    }
  ]
}