2017-04-21 96 views
1

我使用VMware Workstation的vmrun.exe来启动Ubuntu 16桌面虚拟机并启动Java Selenium Firefox进程。我可以启动并启动脚本,但是我希望在用户希望监视它的情况下可以看到硒过程。当尝试使用可见的GUI启动Firefox时,会出现以下错误。使用VMRUN在没有XVFB的Ubuntu VM中执行硒进程

org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/home/vmdops/firefox/firefox) on port 7055; process output follows: 
Error: GDK_BACKEND does not match available displays 

以下bash脚本用于启动过程

java -jar seleniumProcess.jar 

我可以执行与XVFB过程无头并在存储器中运行硒过程然而然后我不能浏览在视觉上运行的进程。

/usr/bin/Xvfb :1 & export DISPLAY=:1 
java -jar seleniumProcess.jar 

什么是正确的术语来解释为什么Firefox浏览器无法显示?

有没有办法从VMRUN启动硒进程,允许firefox浏览器正常显示?

感谢 康特

回答

0

我能够分辨添加-interactive问题的命令

vmrun -T player -gu vmdops -gp xxxx runScriptInGuest "C:\VMDOPS2\VMDOPS2.vmx" /bin/bash "sh /home/vmdops/autovpn/runProfiler.sh" -interactive 

当交互已经登录使用该作品的结尾。启动虚拟机后,当我启动太快时,出现以下错误。

Error: The specified guest user must be logged in interactively to perform this operation 

因此必须启动后等待一段时间。