我在VPS上启动selenium独立服务器时遇到了麻烦
root@PIV:/usr/share/nginx/pivdev/tests# java -jar selenium-server.jar 输出:
21:53:08.857 INFO - Launching a standalone Selenium Server
21:53:08.911 INFO - Java: Oracle Corporation 24.79-b02
21:53:08.914 INFO - OS: Linux 3.13.0-52-generic amd64
21:53:08.945 INFO - v2.47.1, with Core v2.47.1. Built from revision 411b314
21:53:09.070 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}] does not match the current platform LINUX
21:53:09.071 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{platform=WINDOWS, browserName=MicrosoftEdge, version=}] does not match the current platform LINUX
21:53:09.071 INFO - Driver class not found: com.opera.core.systems.OperaDriver
21:53:09.071 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered在那之后就没有输出了。在本地,相同的命令工作起来就像一种魅力。有什么办法解决这个问题吗?
Java
root@PIV:/usr/share/nginx/pivdev/tests# java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)更新1
该服务根本没有在任何端口上运行。
Netstat输出
root@PIV:~# netstat -plnt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 898/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1247/sendmail: MTA:
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 974/mysqld
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 1247/sendmail: MTA:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1005/nginx
tcp 0 0 0.0.0.0:81 0.0.0.0:* LISTEN 1005/nginx
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 496/vsftpd
tcp6 0 0 :::22 :::* LISTEN 898/sshd
tcp6 0 0 :::35484 :::* LISTEN 2036/java
tcp6 0 0 :::50920 :::* LISTEN 2036/java
tcp6 0 0 :::8080 :::* LISTEN 2036/java 更新2
好的,这里的主要问题是selenium服务器在启动时被卡住了,我不知道为什么。我毁了我的VPS机器,从零开始。selenium服务器启动了一次,在我停止并重新启动之后,问题发生了(并且在重新启动后仍然存在)。有时它甚至在第一次尝试时也不起作用。
我不确定这是java问题、selenium服务器问题还是我的VPS主机问题。
发布于 2015-09-23 02:19:59
长篇短篇小说:
Selenium使用/dev/随机(不知道为什么,不要问),它等待足够的熵来生成随机数。
修复
只需在启动selenium:-Djava.security.egd=file:///dev/urandom switch时添加该参数,就可以了
发布于 2015-09-22 04:59:03
在linux上运行时,最好使用一些功能启动selenium服务器,如下所示:
java -jar selenium-server.jar -Dwebdriver.chrome.bin=/path/to/google-chrome -Dwebdriver.chrome.driver=/path/to/chromedriver -browser browserName=chrome platform=LINUX -port 4444另外,也不确定您的本地系统是否是Linux。
https://stackoverflow.com/questions/32707201
复制相似问题