Unable to click on file to upload it

I have some files that require to be uploaded from a folder after I click on the Upload file button in chrome. I’ve tried using Window messages which is the fastest, however, if the file is not fully visible, it won’t be able to click on it unless I manually scroll down. Hardware has the same result. Simulate is not supported either. Not sure what else to do.

Hello @private_matter, check if any of these options can help you! :slight_smile:

  1. Use Element Interactions: Instead of relying on Window messages or hardware events, use UiPath’s element interactions to interact with the “Upload file” button and select the file from the folder.

You can use activities like “Click,” “Type Into,” or “Set Text” to interact with the file upload button and then use the “Select File” activity to specify the file path you want to upload. This way, you can bypass the need for scrolling or visibility issues.

  1. Scroll to Element: If the file upload button is not visible on the screen, you can use UiPath’s “Scroll Into View” activity to scroll to the element before interacting with it. This activity helps bring the element into view, making it accessible for interaction.
  2. Use Hotkeys: Consider using hotkeys to navigate and interact with the file upload dialog. For example, you can use the “Type Into” activity with the file path and then use the “Send Hotkey” activity to press “Enter” to confirm the file selection.
  3. JavaScript Injection: If the file upload button cannot be interacted with directly, you can try injecting custom JavaScript code using the “Execute JavaScript” activity in UiPath. The JavaScript code can trigger the file upload dialog and specify the file path for upload.
  4. Use Different Browsers: If the issues persist in Chrome, try testing the automation in different web browsers like Firefox or Microsoft Edge. Different browsers may have slightly different behaviors when handling file upload dialogs, and your automation might work better in one of them.
  5. Consider Browser Extensions: Some websites may have specific extensions or plugins that affect the behavior of file upload dialogs. Make sure to check for any extensions that might interfere with the automation process and disable them if necessary.

Hello rodrigo,

Mouse scroll might work. Thanks for the tips.

1 Like

Hi @private_matter

When you click on upload a window will open in that pass the file path to the file name option in that window by using type into activity it will pick the file automatically.

If you give click activity to click on file if any files added to that folder the click doesn’t work.

Hope it helps!!

hey @mkankatala

Yes but if I try to do this method, I will still need to get the text for each element and iterate with each file name which also results in the same thing. I’ve already tried that. If the file is not visible, it simply won’t be able to extract the text.

Okay @private_matter

Understand you have to select the file in the window right. Use mouse scroll activity to scroll untill the file appears then use click activity.

Hope you understand!!

That’s what I’m doing.

Got it @private_matter

Happy Automation!!

Thanks. But scrolling is not working well and fast. It’s very slow. Especially that every time the popup window appears, the bot will have to scroll from the very top. I have over 1000+ files. But I got another idea. To move uploaded files to another folder without the need to iterate and scroll down.

Finding of a file in 1000 files is hard with mouse scroll activity.
In the automation itself create a folder using create folder activity.
In that folder download all the files.
Then iterate the folder to get the each file use the for each file in folder activity.

Hope it helps!!

The files are already downloaded. I only to upload the files. I might find a way to extract all the file names and then iterate through each. Will see. Thanks anyways! @mkankatala :slightly_smiling_face:

@private_matter Can you show me file explorer window when you click to attach the file

Don’t click the file, type its path and filename into the box.

@raja.arslankhan it is chrome window not directly from file explorer. the window only appears when I click on the upload button from the browser.

→ Take an assign activity and create a list of string variable called DownloadedFiles
- Assign → DownloadedFiles = Directory.GetFiles(“Give the folder path here”).
→ Use for each activity to iterate the each file in the folder.
→ Inside the for each give a assign and create a string variable called Filename.
- Assign → Filename = System.IO.Path.Getfilenamewithoutextension(Currentitem).toString
→ After the Assign use If to check the file name with the current file name.
→ Inside the If use the required activities for the further workflow.

Hope it helps!! @private_matter

1 Like

Waw! That was brilliant from you @mkankatala! Worked flawlessly. I was able to iterate through all the names without any extensions which can be searched and uploaded. Thanks a lot. I can finally continue with my project. Cheers :star_struck:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.