问题标签 [xvfb]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1394 浏览

google-chrome - 在无头 debian 系统上通过 Selenium 启动 google-chrome

我正在尝试以禁用的网络安全模式启动 google-chrome 浏览器。硒日志说:

无论如何,它只是挂起

这是堆栈跟踪:

16:36:44.605 ERROR - Failed to start new browser session, shutdown browser and clear all session data org.openqa.selenium.server.RemoteCommandException: timed out waiting for window 'null' to appear at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:564) at org.openqa.selenium.server.FrameGroupCommandQueueSet.waitForLoad(FrameGroupCommandQueueSet.java:521) at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:374) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:125) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:87) at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:785) at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:422) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:393) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:146) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482) at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909) at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820) at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986) at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837) at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243) at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357) at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

Selenium 由 robotsframework-maven-plugin 启动。xvfb 也由 maven 构建脚本启动以模拟显示。但是启动配置似乎不是问题。一切都很好,只是浏览器无法启动。

我希望任何人都可以帮助我。

0 投票
1 回答
1258 浏览

javascript - 带有 Xvfb 的 Headless Selenium - JavaScript 不工作,但没有

I'm using Selenium on a Headless Linux machine with Xvfb and Firefox and got a little strange behaviour:

I have a button, which opens a inline popup with javascript and does a postback and load the content in the page if no javascript is enabled. I also have a -tag in my page to show the visitor that they should enable JS.

When I now run a test with selenium to check if the popup is openend the test fails and on the screenshot which is taken on failure I see the static page which should apear when JS is disabled BUT the noscript-Tag is not visible --> what going on here, because I can't even reproduce this "outside of selenium" because either the popup opens or the noscript-Tag is visible?

0 投票
2 回答
2215 浏览

selenium - 为什么 selenium 挂在 INFO - Checking Resource aliases 上,我该如何调试呢?

我正在尝试按照此处的教程设置与 jenkins 的无头硒测试运行。我正在运行 CentOS 5.6,并且已按照说明进行操作。现在,当我运行这个时:

export DISPLAY=":99" && java -jar /var/lib/selenium/selenium-server.jar -browserSessionReuse -htmlSuite *firefox http://www.google.com ./test/selenium/html/TestSuite.html ./target/selenium/html/TestSuiteResults.html

硒坚持下去INFO - Checking Resource Aliases。我可以TestSuite.html手动运行文件,路径是正确的。

我什至如何开始尝试弄清楚发生了什么?有没有办法可以连接到显示器以查看发生了什么?我支持公司代理,但无论有没有-Dhttp.proxyHost争论,我都会得到相同的挂起结果。

0 投票
1 回答
1046 浏览

python - 子进程没有调用我的命令(或者做错了)

概述:

我有一个应用程序,有时必须用芹菜制作一些东西——如果它是简单的任务,比如计算一些东西——一切都很好。

我有一项任务必须使用 MS Windows 程序将现有文件转换为另一个文件。所以-我安装了 WINE,然后安装了应用程序并将以下任务添加到我的 tasks.py:

问题:

该命令未被调用或被调用但没有发生任何事情(文件系统中的任何地方都没有新文件) - 但是如果我从 bash 或交互式 python shell 调用这个命令,一切都很好。

编辑: 当我从命令行调用命令时,我得到这个:

0 投票
2 回答
4507 浏览

python - 从 Python 运行 Xvfb

我正在一个没有 X 服务器的服务器上工作,并尝试运行一个使用 spynner 模块的脚本,这需要 X 服务器。为此,我想运行 Xvfb。

我可以通过调用它来运行脚本xvfb-run,即:

这没有问题。但是,我需要从脚本中调用 Xvfb。为此,我尝试使用 subprocess 如下:

将这段代码添加到脚本的开头后,并尝试将脚本运行为

我收到消息:

还有什么我需要做的吗?提前致谢。

0 投票
2 回答
10939 浏览

xvfb - xvfb - 我在哪里下载 xvfb 独立包?

我想使用 xvfb 来自动化在我的网站的 url 上创建缩略图图像的过程。

目前尚不清楚我应该在哪里下载独立的 xvfb 应用程序。我在哪里下载包?如何构建包?

是否有任何其他软件包可以使用 php 或 shell 脚本在 linux 服务器上创建渲染 url 的图像?

我使用的是 Linux Red Hat Enterprise Linux Server 5.5 (Tikanga)

0 投票
1 回答
4363 浏览

amazon-ec2 - 有人用 CentOS 在 EC2 上运行 Xvfb 吗?

我正在尝试按照本教程在 EC2 中的 CentOS 上运行启用 javascript 的黄瓜:http: //makandra.com/notes/1391-how-to-hide-your-selenium-browser-window-with-headless但是,需要 javascript 的场景只是失败,没有任何异常消息。

为了调试,我只是根据本教程查看 Xvfb 是否正常工作:http ://blog.kabisa.nl/2010/05/24/headless-cucumbers-and-capybaras-with-selenium-and -哈德森/

我测试了命令:

我收到这样的错误消息:

我搜索了有关这些错误的解决方案。我还没有找到一个好的解决方案。如果我再次运行相同的命令,我会得到:

所以服务器应该已经启动并运行。但是,当我尝试在后续操作中运行它时:

控制台只是挂在那里,直到我控制 + C 来杀死它。有没有人知道这里发生了什么?

提前致谢。

0 投票
1 回答
1677 浏览

python - 用于多个进程的 xvfb 实例

我正在 webfaction 的一台服务器上开发一个应用程序。我有一个 python 类,其中定义了两个函数。每个函数都使用一个 spynner.Browser() 对象,它需要运行 X 服务器。为此,我正在运行 Xvfb。

这两个功能都按预期自行运行。当我尝试在不同的线程中同时运行它们时,就会出现问题。当我这样做时,它们都不起作用。我当前的 Xvfb 设置如下:

我在外部运行 Xvfb 以显示数字 99,然后在每个函数的开头,我将 DISPLAY 变量设置为 99,如下所示:

os.environ["DISPLAY"] = ":99"

我看不到这两个功能的任何输出。我也尝试过运行两个具有不同显示编号的不同 Xvfb 实例,然后将每个函数连接到不同的显示,这也不起作用。根据日志,我从其中一个线程中得到了分段错误。

还有什么我需要做的还是我做错了什么?

0 投票
4 回答
53687 浏览

google-chrome - 在没有显示的 Linux 服务器上运行 Chrome WebDriver

我想在 linux 服务器上使用 selenium2 的 chrome webdriver 运行自动化测试。

我已经使用 Xvfb 将 firefox 设置为在服务器上运行(参见http://www.semicomplete.com/blog/geekery/xvfb-firefox.html),并且想用 chrome 做类似的事情。这可能吗?

0 投票
3 回答
4839 浏览

ruby - Capybara-webkit、rspec 集成规范和 xvfb:webkit_server:致命 IO 错误:客户端被杀死

我正在尝试使用无头 gem、xvfb 和 capybara-webkit 在 ubuntu 服务器 CI 盒上运行一套集成规范,以进行无头测试。一切都在本地开发盒上运行良好,但一旦转移到 CI 服务器,事情就会变得有趣。

在规范助手中有一些代码包装:js 在无头块中启用了集成规范,如下所示:

就像我说的,这一切都在本地开发盒上运行良好。在 CI 上,它使用 headless gem 和 xvfb 作为同一用户对不同项目进行测试,当规范需要实例化浏览器实例时,尝试运行集成规范会导致以下错误:

webkit_server:致命的 IO 错误:客户端被杀死

我一直试图找出可能导致该错误的原因,但甚至找不到可能来自何处的痕迹,或任何其他有助于调试问题的信息。

到目前为止,我已经检查/尝试了以下内容:

  • CI 用户绝对有权限运行 xvfb
  • 以 CI 用户身份运行“Xvfb :99 -ac”会给出一个关于未找到字体的警告,没有其他问题

有没有人知道可能导致这种情况的原因,或者我可以在哪里寻找更多信息?我对此感到很困惑。

谢谢!