简体   繁体   English

在 jenkins 上运行 selenium 测试时出错

[英]Errors when running selenium tests on jenkins

I am using WebDriverManager (WebDriverManager.firefoxdriver().setup()) to manage the binary files in my selenium tests.我正在使用 WebDriverManager (WebDriverManager.firefoxdriver().setup()) 来管理我的 selenium 测试中的二进制文件。 Locally I can run my tests but on jenkins I get errors.在本地我可以运行我的测试,但在 jenkins 上我得到错误。 Is it possible to use WebDriverManager with jenkins?是否可以将 WebDriverManager 与 jenkins 一起使用? Do I need to configure anything in order to make my tests run also on jenkins?我是否需要配置任何东西才能让我的测试也在 jenkins 上运行?

[TestNG-tests-1] INFO io.github.bonigarcia.wdm.WebDriverManager - Reading 
https://chromedriver.storage.googleapis.com/ to seek chromedriver
[TestNG-tests-1] INFO io.github.bonigarcia.wdm.online.Downloader - Downloading 
https://chromedriver.storage.googleapis.com/86.0.4240.22/chromedriver_linux64.zip
[TestNG-tests-1] INFO io.github.bonigarcia.wdm.online.Downloader - Extracting driver from 
compressed file chromedriver_linux64.zip
[TestNG-tests-1] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting 
webdriver.chrome.driver as 
/home/jenkins/.cache/selenium/chromedriver/linux64/86.0.4240.22/chromedriver
/home/jenkins/.cache/selenium/chromedriver/linux64/86.0.4240.22/chromedriver: error while 
loading shared libraries: libnss3.so: cannot open shared object file: No such file or 
directory

As you are downloading the Chromedriver and extracting it, I guess Extraction is not happening.当您下载 Chromedriver 并提取它时,我猜提取没有发生。 Did you try placing the Chrome driver at a particular location and point it in pipeline syntax that location to execute.您是否尝试将 Chrome 驱动程序放置在特定位置并将其指向要执行的管道语法中的位置。 I think it should work in that way.我认为它应该以这种方式工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM