我是使用 QAF 自动化框架的新手。我遵循了此页面上的文档 - https://qmetry.github.io/qaf/latest/setting_driver_capabilities.html
我的要求是:我必须在我的测试中下载一个文件,下载应该去我项目的下载文件夹,而不是 macbook/test 机器的下载文件夹。
我正在使用 chromeDriver 并且必须在 QAF 框架内的 application.properties 文件中设置 chrome 功能。我添加了以下内容,但它不起作用
chrome.capabilities.profile.default_content_settings.popups=0
chrome.capabilities.download.default_directory=/downloads
chrome.capabilities.credentials_enable_service=false
chrome.capabilities.profile.password_manager_enabled=false
chrome.capabilities.CapabilityType.ACCEPT_SSL_CERTS=true
chrome.additional.capabilities={"chrome options":{"args":["--headless -
-disable-gpu"]}}
我还尝试直接将 chrome.additional.capabilities 用于我想要设置的所有功能,如下所示,它也不起作用
chrome.additional.capabilities={"chrome options":{"args":["--allow-
outdated-plugins","--always-authorize-plugins","--headless --disable-
gpu","-disable-extensions"]},"prefs":
[{"profile.default_content_settings.popups":0},
{"download.default_directory":"/downloads"},
{"credentials_enable_service":false},
{"profile.password_manager_enabled":false}]}
当我执行测试时,测试成功运行并通过,但文件下载到我的 macbook 下载目录,而不是我使用功能设置的项目特定下载文件夹中。
我尝试使用 chromeDriver.capabilities 而不是 chrome.capabilities 没有成功。
以前使用过 QAF 的人可以帮我解决这个问题吗?