[英]How to fix 'Program install error' related to Xvfb and selenium on a Mac?
I am trying to se a Mac (MacOS 10.13.3) to run selenium tests in an headless environment. 我正在尝试设置Mac(MacOS 10.13.3)在无头环境中运行硒测试。 I am doing basically the following:
我基本上在做以下事情:
from pyvirtualdisplay impot Display
display = Display(visible=0, size=(13660, 7680))
display.start()
before invoking the selenium webdriver (selenum 3.8.0). 在调用Selenium Webdriver(Selenum 3.8.0)之前。 However, I get the following error:
但是,出现以下错误:
self = <EasyProcess cmd_param=['Xvfb', '-help'] cmd=['Xvfb', '-help'] oserror=[Errno ... directory return_code=None stdout="None" stderr="None" timeout_happened=False>
def check_installed(self):
"""Used for testing if program is installed.
Run command with arguments. Wait for command to complete.
If OSError raised, then raise :class:`EasyProcessCheckInstalledError`
with information about program installation
:param return_code: int, expected return code
:rtype: self
"""
try:
self.call()
except Exception:
> raise EasyProcessCheckInstalledError(self)
E EasyProcessCheckInstalledError: cmd=['Xvfb', '-help']
E OSError=[Errno 2] No such file or directory
E Program install error!
venv_pytest/lib/python2.7/site-packages/easyprocess/__init__.py:180: EasyProcessCheckInstalledError
Because it looks like an issue with xvfb
I tried to install it: 因为它看起来像
xvfb
的问题, xvfb
我尝试安装它:
>pip install xvfb
Collecting xvfb
Could not find a version that satisfies the requirement xvfb (from versions: )
No matching distribution found for xvfb
I also tried the following: 我还尝试了以下方法:
>brew install xvfb
Error: No available formula with the name "xvfb"
What else can I try? 我还能尝试什么?
Addendum: I am not loking for something else. 附录:我不是在寻找别的东西。 I am looking to make the above work on a Mac to develop the tests.
我希望在Mac上进行上述工作以开发测试。 The tests will run in a sane Linux environment (of course not Mac!!) which is perfectly settled to work with
xvfb
... 这些测试将在合理的Linux环境(当然不是Mac !!)中运行,这完全适合与
xvfb
一起xvfb
...
Xvfb is almost certainly not what you want here. Xvfb几乎肯定不是您想要的。
The macOS desktop interface is not based on X11. macOS桌面界面不基于X11。 Xvfb implements a virtual X11 display;
Xvfb实现了虚拟的X11显示; it can only be used to run X11 applications -- none of which are installed by default on macOS.
它只能用于运行X11应用程序-在macOS上默认未安装任何应用程序。
macOS does not support headless operation. macOS不支持无头操作。 If you want to run Selenium tests on macOS, you will likely need to run them on your desktop.
如果要在macOS上运行Selenium测试,则可能需要在桌面上运行它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.