我在新的数字海洋ubuntu 14.04服务器上部署了selenium独立服务器。它无法正常启动。它给出的日志是
13:33:57.853 INFO - Launching a standalone server
13:33:57.929 INFO - Java: Oracle Corporation 25.25-b02
13:33:57.930 INFO - OS: Linux 3.13.0-37-generic amd64
13:33:57.950 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
13:33:58.060 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match with current platform: LINUX
13:33:58.191 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
13:33:58.196 INFO - Version Jetty/5.1.x
13:33:58.199 INFO - Started HttpContext[/selenium-server,/selenium-server]
我猜日志中缺少2行。
14:54:06.454 INFO - Started SocketListener on 0.0.0.0:4444
14:54:06.462 INFO - Started org.openqa.jetty.jetty.Server@b1bc7ed
有没有人知道它为什么会发生?
答案 0 :(得分:9)
当硒试图生成随机种子时会发生这种情况,但内核缺乏熵。
解决方案是安装添加haveged
等熵的软件。见https://www.digitalocean.com/community/tutorials/how-to-setup-additional-entropy-for-cloud-servers-using-haveged
答案 1 :(得分:1)
在RHEL 7上有同样的问题......也是熵
检查您是否有同样的问题:
cat /proc/sys/kernel/random/entropy_avail
显示一个非常低的数字......(我有3个)
让它运作起来:
yum install rng-tools
systemctl enable rngd.service
systemctl start rngd.service
之后,这个数字上升到了3000,而selenium服务器出现了......
答案 2 :(得分:0)
由于端口冲突,这发生在我身上。如果其他进程在4444上运行,Selenium就不会启动,而Nightwatch也不会告诉你错误。
在nightwatch.json中将端口更改为4445,为我修复了它:
"selenium" : {
...
"port" : 4445,