如何在Web服务器中运行Selenium脚本? [英] How to run Selenium Scripts in webservers?

查看:270
本文介绍了如何在Web服务器中运行Selenium脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一些Selenium [Python] Webdriver脚本,尽管它们在我的系统上运行良好,但并未在我网站的服务器上运行.它显示Firefox错误. Firefox已安装在服务器上.该网络服务器是Ubuntu.我必须怎么做才能运行这些脚本?请帮助,我是新手.

I have written a few Selenium [Python] webdriver scripts, and while they are running fine on my system, they are not running on my website's server. It is showing errors with Firefox. Firefox is installed on the server. The webserver is Ubuntu. What do I have to do to run those scripts? Please help, I am a newbie.

推荐答案

Selenium需要运行的浏览器,而浏览器需要某种X服务器才能运行. X服务器的类型很多,其中一种是

Selenium requires a running browser and browsers need some kind of X server in order to run. There are many types of X servers and one of them is Xvfb aka X virtual framebuffer that does all the operations in memory and thus requires no screen.

在Wikipedia中,您可以找到非常好的示例.

In Wikipedia you could find very nice examples.

这也是一个很好的示例.

这篇关于如何在Web服务器中运行Selenium脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆