我试图用Custom Profile通过Selenium推出Firefox浏览器。我下载了最新的geckodriver并以下列包括它:的Node.js和Webdriver.io硒独立服务器不容使用自定义配置文件
java -Dwebdriver.firefox.driver="C:\\xampp\\htdocs\\project\\geckodriver.exe" -jar selenium-server.jar
注:我使用硒独立服务器3.5.0。
然后,在我的节点脚本使用:
const options = {
desiredCapabilities: {
browserName: 'firefox',
firefox_profile:"C:/Users/Administrator/AppData/Local/Mozilla/Firefox/Profiles/Prnlx0rh6w.bookmarks_player"
}
}
const client = webdriverio.remote(options).init();
看来,当我看着硒日志工作。因为Windows temp
文件夹中不会创建临时配置文件(与新会话相同),所以您可以从上方看到配置文件。但它不起作用!
Firefox的衍生实例没有加载cookie或插件或任何东西。它每次都像新鲜的版本。我也试过用firefox_profile
,profile
或"moz:profile"
来代替。我甚至试图用fs
作为base64
字符串导入配置文件。没有真正的工作。也许我只是写错了?
如何使用WebdriverIO包含Firefox自定义配置文件?
!!!编辑:也试过以下C:\Users\Administrator\AppData\Local\Mozilla\Firefox\Profiles\Prnlx0rh6w.bookmarks_player
我也尝试了双反斜杠,但结果与同样的结果。我试图安装Firefox Addon,但每次新的启动都会消失。还没有找到cookie。
感谢您的awnser但遗憾的是同样的结果。我还更新了给你的问题的问题。 – t33n