问题描述
所以 Selenium-standalone 提供了它的 API to manage Selenium configs
但是,该文件位于节点模块本身 (node_modules/selenium-standalone/lib/default-config.js) 中,因此如果删除节点模块,我在其中设置的所有配置都将消失。
而且由于它是作为 devDependency 添加的,所以我并不真正关心生产(如果有任何意义),但至少我想要的是在启动服务器时提供我的配置文件- selenium-standalone start
或在 npm i
发生时添加配置文件。或者在重新安装节点模块时我还能做些什么来保留该文件?
解决方法
有一个标志来指定自定义配置文件:
npx selenium-standalone install --config=/path/to/config.json