0

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?

1 Answers1

0

I was able to solve the issue by following steps to install chromium from debian in Chromium without snap.

Problem is that Chrome version there is 83, while version in snap is 86 and I would like to test in latest version of course. Although for this case it is probably not important, it may be important for different things.

Is there different, better way?