问题描述
我正在设置CI作业,以便在Gitlab CI中进行硒中的自动化测试,但是由于该问题,测试失败.
I'm setting up the CI job for automated testing in selenium inside Gitlab CI, but the test is failing due to the issue.
019-09-27T11:03:17.404Z INFO @ wdio/cli:启动器:运行在准备钩子上/builds/shauryav/test-react-ci-cd/node_modules/chromedriver/lib/chromedriver/chromedriver:加载共享库时出错:libnss3.so:无法打开共享库文件:没有这样的文件或目录
019-09-27T11:03:17.404Z INFO @wdio/cli:Launcher: Run onPrepare hook/builds/shauryav/test-react-ci-cd/node_modules/chromedriver/lib/chromedriver/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
我尝试了许多解决方案,例如安装软件包"@ wdio/cli":"^ 5.13.2","webdriverio":"^ 5.13.2",但没有任何效果.需要注意的是,我没有使用任何Docker设置
I have tried numbers of solutions like installing package "@wdio/cli": "^5.13.2", "webdriverio": "^5.13.2" but nothing works. For the note, I'm not using any docker setup
/builds/shauryav/test-react-ci-cd/node_modules/chromedriver/lib/chromedriver/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
2019-09-27T11:03:27.415Z ERROR @wdio/cli:utils: A service failed in the 'onPrepare' hook
Error: timeout
at Timeout.timeoutFunc (/builds/shauryav/test-react-ci-cd/node_modules/tcp-port-used/index.js:204:25)
at listOnTimeout (internal/timers.js:531:17)
at processTimers (internal/timers.js:475:7)```
推荐答案
尝试这些命令
易于安装libnss
apt安装libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev
如果上述命令不起作用,请执行以下命令
if the above commands didn't work then go for the below one
sudo apt install libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev
这篇关于“加载共享库时出错:libnss3.so"在运行Gtlab CI作业以使用webdriverio执行自动化测试时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!