Chrome update disabled the file upload feature? {"code":-32000,"message":"Not allowed"}


#1

This is since the Chrome 72.0.3626.81 update. It seems to me all web automation tools are affected. When I search for the error, I find similar error reports in the Selenium IDE ticket system, the Katalon forum and the iMacros forum :roll_eyes:

type on id=imagepp with value c:\testdata\passport1.png Failed:

{"code":-32000,"message":"Not allowed"}

Macro stops at file selection window on chrome(windows 7)
#2

Yeah, we see the same issue since a few days. Now Chrome is at 72.0.3626.96 and the problem is still there. Normally Kantu (just like all other tools you mentioned) would use Chrome’s debugging API to perform file uploads. But since the latest Chrome updates Kantu stops at the “Kantu… is debugging this browser” message.

cdbaby

But the solution is easy: Until the Chrome team allows automated file uploads again via its extension API you can use xtype to automate file uploads:

  • click| id=imageFile (open upload file picker)
  • xtype | f:\\testcases\\data\\up1.png
  • xtype | ${KEY_ENTER}

The xtype solution has the great advantage that it works for file uploads in Firefox, too :smiley:

Demo macro:

{
  "Name": "file-upload-with-xtype",
  "CreationDate": "2019-2-9",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://ocr.space/",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "id=imageFile",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "f:\\testcases\\data\\up1.png",
      "Value": ""
    },
    {
      "Command": "XType",
      "Target": "${KEY_ENTER}",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "link=Start OCR!",
      "Value": ""
    }
  ]
}

Is firefox file upload through file input is not avaialble yet?