本文介绍了是否可以在没有GUI的情况下运行Selenium(Firefox)Web驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在考虑将生产服务器从Ubuntu- 台式机 10.04升级到Ubuntu- 服务器 12.04.

We are considering upgrading our production server from Ubuntu-desktop 10.04 to Ubuntu-server 12.04.

我们在当前的桌面操作系统上运行着各种服务,例如Selenium Web Driver.我的问题是Selenium Web Driver是否可以从基于cli的系统中运行?

We have various services running on our current desktop OS such as Selenium Web Driver. My question is can the Selenium Web Driver be run from a cli-based system?

我立即想到它不能,因为它依赖于Firefox,但是我希望有人证明我做错了!

My immediate thought is that it can't, because it relies on Firefox, but I'd like for someone to prove me wrong!

推荐答案

您正在寻找的是无头浏览器.

是的,有可能在Firefox上无头运行Selenium.这是您的帖子可以跟随.

Yes, it's possible to run Selenium on Firefox headlessly. Here is a post you can follow.

以下是设置Xvfb的摘要步骤

Here is the summary steps to set up Xvfb

#install Xvfb
sudo apt-get install xvfb

#set display number to :99
Xvfb :99 -ac &
export DISPLAY=:99

#you are now having an X display by Xvfb

这篇关于是否可以在没有GUI的情况下运行Selenium(Firefox)Web驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 12:43