For reading and uploading a local file, you need to use real user simulation with XClick and XType. The macro below works fine:
{
"Name": "read local file",
"CreationDate": "2023-5-11",
"Commands": [
{
"Command": "open",
"Target": "https://www.ilovepdf.com/word_to_pdf",
"Value": "",
"Description": ""
},
{
"Command": "comment",
"Target": "click // xpath=//*[@id=\"pickfiles\"]/span",
"Value": "",
"Description": "FAILS, must use XCLICK"
},
{
"Command": "XClick",
"Target": "xpath=//*[@id=\"pickfiles\"]/span",
"Value": "",
"Description": ""
},
{
"Command": "pause",
"Target": "2000",
"Value": "",
"Description": "Wait for file dialog to open"
},
{
"Command": "XType",
"Target": "C:\\Users\\dev1\\Desktop\\test123.docx",
"Value": "",
"Description": "Send path"
},
{
"Command": "XType",
"Target": "${KEY_ENTER}",
"Value": "",
"Description": "Send path"
},
{
"Command": "click",
"Target": "id=processTask",
"Value": "",
"Description": ""
}
]
}