Problem
I am clicking on 'Upload file' in a web application, this results in a modal 'Please Choose a File to Upload' type prompt.At this point I'm stuck. I cannot seem to identify the modal dialog box to perform the upload.
Solution
Let's try a built in Robot Framework keyword...
Choose File
which takes two parameters. An environment and a file path/file.
I had a guess at a couple of xpaths to the dialog
//input[@type='file']seems to be sufficient.
Next the file path.
I seem to be getting an error logged as INFO,
INFO File ''C:/cat_in_hat.jpg'' does not exist on the local file system
...okay. I'm pretty sure it does. So, how to resolve.
Documentation:
The file specified with `file_path` must be available on the same host where the Selenium Server is running
On Windows I simply have my filename kinda like ${filename}= Set Variable
... C:\\Users\\Documents\\random.csv
And it all works a-okay.