Selenium webdriver WebDriverError:找不到文件

Selenium webdriver WebDriverError:找不到文件,selenium-webdriver,webdriver,Selenium Webdriver,Webdriver,我收到以下Selenium WebDriver错误: WebDriverError: File not found: /Users/foo/bar/nabisco/cdt-now/csv-data/IT-DE-Yasper.csv 问题是,这个文件完全存在于文件系统中。selenium服务器正在本地运行。所以我不知道为什么它找不到文件。有人知道吗?如果您使用Firefox 55,即使文件存在,最近的错误也会导致此异常发生。 看 在修复错误之前,有一个解决方法:将Firefox首选项“dom.f

我收到以下Selenium WebDriver错误:

WebDriverError: File not found: /Users/foo/bar/nabisco/cdt-now/csv-data/IT-DE-Yasper.csv

问题是,这个文件完全存在于文件系统中。selenium服务器正在本地运行。所以我不知道为什么它找不到文件。有人知道吗?

如果您使用Firefox 55,即使文件存在,最近的错误也会导致此异常发生。 看

在修复错误之前,有一个解决方法:将Firefox首选项“dom.file.createInChild”设置为“true”

例如:

FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("dom.file.createInChild", true);
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
WebDriver driver = new FirefoxDriver(capabilities);

你能粘贴你的代码片段吗