How can I set relative folder path or file path instead of absolute path using send keys for the Windows File Dialog.
Also, if the robot is using the Windows File dialog, can it be executed in the Control Room?
I’ve had difficulty with File Open dialogs in the past with Windows applications. One problem is that the File name edit box did not have a unique identifier, at least as far as I could see. I ended up with the following, which was to put into the clipboard the filename first and with the dialog opened, as the focus starts off in the filename edit box, paste it.
*** Settings ***
Library RPA.Desktop.Windows
Library RPA.Desktop
*** Tasks ***
Open File From Within Notepad
Open executable notepad.exe Untitled - Notepad
Menu Select File->Open...
# Set filename to open into Clipboard
Set Clipboard Value ${CURDIR}${/}HelloWorld.txt
# Paste into Open File Dialog and press <enter>
Send Keys To Input ^v
I’ll note the Set Clipboard Value keyword comes from the RPA.Desktop library. I know this is not exactly your problem but hopefully this is helpful. I’ll also add there are a few methods for handling file upload within the browser, of which I have no real experience doing, but someone else might have a different approach that may also be helpful.
It looks like you are trying to use the default output directory for your robot. If that’s the case you can try using the ${OUTPUT_DIR} variable (it’s a builtin variable that points to the robot’s output folder). We discuss that variable here: Collecting the results. If this doesn’t work for you let me know and we can try to find another solution.