I am trying to download a file with selenium/python and later read from that file.
When I use non remote driver as below, it downloads file and all is gucci
def initialize():
global instance
chrome_options = webdriver.ChromeOptions()
prefs = {'download.default_directory':'/Users/dusandev/Desktop/StreamFlowWebTests/reporting/wallets'}
chrome_options.add_experimental_option('prefs', prefs)
instance = webdriver.Chrome(chrome_options=chrome_options)
instance.implicitly_wait(2)
return instance
However, when I use remote driver, it fails with and does not download the file.
def initialize():
global instance
chrome_options = webdriver.ChromeOptions()
prefs = {'download.default_directory':'/Users/dusandev/Desktop/StreamFlowWebTests/reporting/wallets'}
chrome_options.add_experimental_option('prefs', prefs)
instance = webdriver.Remote('http://localhost:4444/wd/hub', DesiredCapabilities.CHROME, options=chrome_options)
instance.implicitly_wait(2)
return instance
The error is following:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/dusandev/Desktop/StreamFlowWebTests/reporting/wallets/solflare-backup.txt'
I also tried to make folder writable with adding rw to the end of the folder like this
{'download.default_directory':'/Users/dusandev/Desktop/StreamFlowWebTests/reporting/wallets:rw'}
That did not work as well.
Do you have any idea? Thank you in advance