How to upload file to Google Drive

Hello, I am newbie in UI.Vision. I created a .csv with Chrome extension and saved it to my desktop. I want upload this .csv to my Google Drive. I tried to record a macro but at the third step the macro stops. When I click on the “New” button the “File upload” link is in a JQuery dropdown menu and the click command can’t hit the link.

{
      "Command": "open",
      "Target": "https://drive.google.com/drive/u/0/my-drive",
      "Value": "",
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\"drive_main_page\"]/div/div[3]/div/button/span[2]",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\"drive_main_page\"]/div/div[3]/div/button/span[2]",
        "xpath=//button/span[2]",
        "css=#drive_main_page > div > div.ZHllM > div > button.brbsPe.Ss7qXc.a-qb-d.brbsPe-W.brbsPe-Pb.brbsPe-pb > span.jYPt8c"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=/html/body/input[2]",
      "Value": "",
      "Targets": [
        "xpath=/html/body/input[2]",
        "xpath=//input[@type='file']",
        "xpath=//body/input[2]",
        "css=body > input:nth-child(55)"
      ],
      "Description": ""
    },
    {
      "Command": "click",
      "Target": "xpath=//*[@id=\":43\"]/div/span[2]/div",
      "Value": "",
      "Targets": [
        "xpath=//*[@id=\":43\"]/div/span[2]/div",
        "xpath=//div[3]/div/span[2]/div",
        "css=#:43 > div > span.a-v-j > div"
      ],
      "Description": ""
    }

Gmail or the Googe Docs/Google Drive website is best automated with XClick and XClickText. And for file upload automation, you need to handle the file dialog, too. This is a browser security feature - normal HTML-level selenium commands like CLICK can not trigger a file upload, otherwise websites could be stealing files.

This file upload post explains how to automate the upload. The same method works for Google Drive!

This video solution is not working in Google Drive. The “New” or “My drive” button click triggers a dropdown menu that contains the “Upload file” link. I can’t figure out how to click on this link with UI.Vision commands.
https://www.digitaltrends.com/wp-content/uploads/2020/02/google-2.jpg?fit=603%2C415&p=1

The best option to automate the GSuite interface is to use computer vision with Xclick.

This will work:

XClick | upload files google drive

Or use

XClickText | Upload - this command uses text recognition (OCR) to find the word “Upload” and clicks on it.