对于selenium测试,我在phpuni environment.conf ment.conf文件中有这个配置
[program:selenium]
command=xvfb-run java -Dwebdriver.firefox.bin=/usr/bin/firefox -jar /usr/share/selenium/selenium-server-standalone.jar
autostart=false ; selenium
[program:python-webserver]
command=python -m SimpleHTTPServer 8080
directory=. ; python-webserver
autostart=false ; python-webserver
[program:php-webserver]
command=php -S localhost:8080
directory=. ; php-webserver
autostart=false ; php-webserver我通过流浪汉做测试。每当我运行任何类型的测试时,我总是得到这个错误
xvfb-run: error: Xvfb failed to start我为这个错误找到了几个解决方案,并尝试了以下方法
command=xvfb-run --auto-servernum --server-num=1 java -Dwebdriver.firefox.bin=/usr/bin/firefox -jar /usr/share/selenium/selenium-server-standalone.jar但是我还是得到了同样的错误。这里我漏掉了什么?
发布于 2016-05-18 18:29:25
下面的代码用于启动XVFB服务器并在无头模式下进行测试,这是为java透视图编写的。
应在CENTOS中运行以下命令
DISPLAY=:99 sudo java -jar -log /root/Seleniumfolder/SeleniumServer.log -host 127.0.0.1 -port 4444 -Dwebdriver.firefox.bin="/usr/bin/firefox“
https://stackoverflow.com/questions/37292014
复制相似问题