Hello Team,
I am performing an operation in browser using UiPath Studio in which I am required to attach a file by clicking Add Attachment button and then using file explorer popup to locate and upload the required file. I want to perform this operation in cross-platform project (in particular for Linux). Could anyone help me with the required activities to perform this task.
Thanks
Hi!
Youâd need all of the basic ones provided in the UiAutomationActivities package such as click, check app state etcâŚ
Activities - Modern activities
I havenât done any cross-platform stuff, but I guess Google Chrome and Firefox both are available and stable on Linux as well as Windows.
Activities - Use Application/Browser
Remember to install the extensions
Studio - Extension for Firefox
Studio - List of extensions for Chrome
Hereâs for Mac as well:
Studio - Chrome Extension on Mac
I am able to perform all the other operations on the application on browser but facing issues with upload task. Previously, we used to have windows project where this was handled with help of UiSelectors, checkAppState, click, etc like you mentioned. But same is not working for Linux machine. So, is there some other way to perform this?
Is the issue only with the browser on your linux machine, or are you able to use the activities on other programs?
The issue happens with Linux machine as the selectors for file-upload popup (added for windows) are not being identified. Is there some another way to achieve this in Linux?
Hie @Akshat_Mittal can you try with clipboard activity or type into activity.
- Open the Browser: Use the
Open BrowserorUse Application/Browseractivity to navigate to the webpage that contains the Add Attachment button. - Click the âAdd Attachmentâ Button: Use the
Clickactivity to click on the âAdd Attachmentâ button that triggers the file explorer. - Locate the File Upload Input Field: If the file input field is visible in the DOM (i.e., part of the HTML structure), you can directly target this field with the
Type Intoactivity. - Use
Type Intoto Input the File Path: Provide the file path as text, and the file input field will accept it as if you typed it manually. - Activity:
Type Into - Text: Provide the file path, for example:
/home/username/Documents/myfile.pdf.
- Set To Clipboard
Text: â/home/username/Documents/myfile.pdfâ - Click
Target the file input field - Send Hotkey
Key: âCtrl + Vâ (to paste the file path)
Getting following error:
Type Into: Type activity verification failed. Expected text: "/home/username/Documents/myfile.pdf". Actual result: "<some_random_text_from_browser_window>".
PS: I am not specifying any target for type into activity
before type into have you tried set Focus window activity. and also for type into make sure selector is more reliable use wild cards and in the ui-explorer add anchor for more reliablity make sure before typing clear filed should be check and one more thing in my case my location path is too long so i tried with simulate click but it some time work and some time before writting full path it goes to next path or not able to write path so i use send window property in the type into and it worked for me .
cheers
Thanks @singh_sumit for the info, but I think there is some confusion here. I am trying to do this for cross-platform project and the activities like set focus is not supported for cross-platform project.
Are u able to perform these steps in cross-platform project?
I see!
And the rest of the activities in the browser works as they should?
Iâm suspecting stuff like file-upload popups are handled by different âprogramsâ on linux and windows. On windows you get the file explorer as a popup, on linux a different program.
Does that make sense?
Seems like you have to detect what platform youâre running on and develop a workflow for handling it in Linux ![]()
Hi,
What is understand is you are getting error typing into Save As/Save dialog, which is OS dialog and not browser popup.
One solution that I can think of is check the OS name using System.Runtime.InteropServices.RuntimeInformation.OSDescription.
Once you get OS name you can use different selectors or Keystrokes for different OS.
yes you are right but what about Anchor and the simulate option and try to go with strict selector. might be help for you