如何解决在Docker容器上运行空手道测试时会覆盖Chrome可执行文件
在下面您可以看到空手道驱动程序的配置如下,然后尝试使用user-data-dir然后使用位置。如何使用--user-data-dir禁用该过程Chrome可执行文件路径:
build-env_1 | 12:10:42.702 [ForkJoinPool-1-worker-1] INFO com.intuit.karate - Karate Driver config:
build-env_1 | {
build-env_1 | "type": "chrome",build-env_1 | "executable": "/usr/bin/karate_chrome_driver",build-env_1 | "port": 9515,build-env_1 | "httpConfig": {
build-env_1 | "readTimeout": 120000
build-env_1 | }
build-env_1 | }
build-env_1 | 12:10:42.727 [ForkJoinPool-1-worker-1] WARN com.intuit.karate - type was null,defaulting to 'chrome'
build-env_1 | 12:10:42.754 [ForkJoinPool-1-worker-1] DEBUG com.intuit.karate.shell.Command - found / verified free local port: 9222
build-env_1 | 12:10:42.759 [chrome_1603973442746] DEBUG c.i.k.driver.chrome_1603973442746 - command: [/usr/bin/google-chrome,--remote-debugging-port=9222,--no-first-run,--user-data-dir=/usr/regression/target/chrome_1603973442746,--disable-popup-blocking]
build-env_1 | 12:10:42.762 [ForkJoinPool-1-worker-1] DEBUG c.i.k.driver.chrome_1603973442746 - poll attempt #0 for port to be ready - localhost:9222
build-env_1 | 12:10:42.762 [chrome_1603973442746] ERROR com.intuit.karate.shell.Command - command error: [/usr/bin/google-chrome,--disable-popup-blocking] - Cannot run program "/usr/bin/google-chrome" (in directory "target/chrome_1603973442746"): error=2,No such file or directory.
解决方法
对不起,您似乎正在尝试混合空手道dist
,并期望它使用"scripts": {
"start": "node ./bin/www"
}
。不支持。可执行文件应该是chrome可执行文件本身,也可以是默认值(推荐)。
也请阅读文档。如果使用chrome
,则可以将chromedriver
添加到配置中,这样它就不会在命令行上使用。
https://github.com/intuit/karate/tree/master/karate-core#configure-driver
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。