I am working with python binding and need to change the Firefox profile through code, I tried following way however it gives error that Firefox profile object is not JSON serializable
caps = { "browserName": "firefox" }
fp = webdriver.FirefoxProfile()
fp.set_preference("browser.download.folderList",2)
fp.set_preference("browser.download.manager.showWhenStarting",False)
fp.set_preference("browser.download.dir", "C:\Downloads")
fp.update_preferences()
desired_capabilities = webdriver.DesiredCapabilities.FIREFOX
desired_capabilities['browserName'] = 'firefox'
desired_capabilities['firefox_profile'] = fp
driver = webdriver.Remote(desired_capabilities=desired_capabilities,
command_executor=remote
)