I have this simple test script, which was working before, but it is not now after upgrading from Ubuntu 18.04 to Ubuntu 20.4
from selenium import webdriver
import os, time
WorkDir = "/tmp/test/"
FileName = "mitmdump"
WebServer = "http://localhost:8000/"
options = webdriver.ChromeOptions()
preferences = {"download.default_directory": WorkDir ,
"download.prompt_for_download": False,
}
options.add_experimental_option("prefs", preferences)
driver = webdriver.Chrome(options=options)
driver.get(str(WebServer) + str(FileName))
while not os.path.exists(str(WorkDir) + "/" + str(FileName)):
print("waiting for file download to finish")
time.sleep(3)
When I turn download.prompt_for_download to True I can see previously downloaded files by this code, however I can't see the files when I look into the /tmp/test using standard terminal or File manager.
Cause of this behavior is that Chromium is installed in snap which contains sandboxed filesystem.
Question is how to run this test?