Upload file to a cloud


#1

How to upload a file to a cloud service?
I tried to record the process but when I execute doesn’t work (the cloud tell me the file C:\fakepathest.mp3 seems not exists…)

    {
  "Command": "open",
  "Target": "https://openload.co/account#multiupload",
  "Value": ""
},
{
  "Command": "click",
  "Target": "//*[@id=\"mu-addfiles\"]/span[2]",
  "Value": ""
},
{
  "Command": "click",
  "Target": "id=muinput",
  "Value": ""
},
{
  "Command": "type",
  "Target": "id=muinput",
  "Value": "C:\\fakepath\\test.mp3"
},
{
  "Command": "click",
  "Target": "//*[@id=\"fileupload\"]/table/tbody/tr/td[4]/button[1]/span",
  "Value": ""
}

#2

for technical reasons Kantu or any other browser extension have no access to the real path where your file is located

The solution is that - after recording - you edit the macro and replace “C:\fakepath\test.mp3” with the real path that points to the file you want to upload


#3

thanks a lot!
And how to wait until uploading is done and then execute other commands?


#4

That depends on the website. Usually “something happens” on the website when the download is complete:

  • If a link or button appears, you can use Click | ID=NewButton - the click commands waits automatically !timeout_wait seconds for the new element to appear

  • If something visually changes, you can use visualAssert | image.png - it waits until the image is found on the website (using image recognition)


#5

Yeah, thanks! And how can i tell kantu “wait until this element is found? ( tag in my case)”


#6

You can use the CLICK command for this. If you use CLICK with a non-hyperlink element the command works exactly like “waitForElement” in webdriver. Or you can use waitForVisible, which waits for element to show up and is visible.