How to make Selenium open a default folder when asked to choose a file?
I'm trying to upload a file in a website using Selenium but when I click to upload the file and the website opens the folders always open in my home directory.
I want to always open in a certain folder and choose the name of the file
Get the id of the input camp
HTML code on the webpage:
<input class="file fl_arquivoFormFile" style="display: inline; width: 254px;">
Like:
upload = self.driver.find_element_by_id("fl_arquivoFormFile")
And:
send.keys(path_to_file) #/home/viper/Documents/file
How to make Selenium open a default folder when asked to choose a file?