本文介绍了是否可以在没有 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