Jaya
Jaya

Reputation: 43

changing default download location in chrome using Pytest_mozwebqa

Can anyone please help how do i change the chrome settings in selenium using pytest to download files to a desired location. what should i add to the below command in run configurations of eclipse to change the download path

--baseurl='http://example.com'--driver=chrome

Upvotes: 0

Views: 2580

Answers (1)

CherryDT
CherryDT

Reputation: 29012

In Python itself, it would be:

chromeOptions = webdriver.ChromeOptions()
chromeOptions.add_experimental_option("prefs", {"download.default_directory": "some/path", "download.directory_upgrade": true})
driver = webdriver.Chrome(executable_path="the/path/to/the/driver.exe", chrome_options=chromeOptions)

Related: https://bugs.chromium.org/p/chromedriver/issues/detail?id=330

If I understand correctly how this "Pytest_mozwebqa" thingy works, you could try adding this command line:

--chromeopts='{"prefs":{"download.default_directory":"some/path","download.directory_upgrade":true}}'

Upvotes: 2

Related Questions