获取GDK_BACKEND与debian中的可用显示错误不匹配 [英] Getting GDK_BACKEND does not match available displays error in debian

查看:2088
本文介绍了获取GDK_BACKEND与debian中的可用显示错误不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实我试图通过硒在远程的debian服务器上运行一个无头浏览器。我在服务器上安装了firefox 46.0.1,我使用的是硒2.53.1版本。

每当我尝试运行一个给定的测试,我得到以下错误。

  org.openqa.selenium.WebDriverException:端口7055无法连接到二进制FirefoxBinary(/ usr / bin / firefox)过程输出如下:
错误:GDK_BACKEND不匹配可用显示

我已经实例化了firefox驱动程序在我这样的代码:

  saDriver = new FirefoxDriver(); 

任何人都可以帮忙吗?

解决方案

您需要在selenium服务器运行的shell中导出显示,否则将无法打开浏览器。

  nohup sudo Xvfb:10  -  ac& 
export DISPLAY = 10


Actually i am trying to run a headless browser in remote debian server through selenium. I have firefox 46.0.1 installed in the server and i am using selenium 2.53.1 version.

Whenever i tried to run a given test i got the following error.

org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows: 
Error: GDK_BACKEND does not match available displays

I have instantiated firefox driver in my code like this:

saDriver = new FirefoxDriver();

can anyone help?

解决方案

You need to export the display in the shell that selenium server is running in otherwise it will not be able to open the browser.

nohup sudo Xvfb: 10 - ac &
export DISPLAY=10

这篇关于获取GDK_BACKEND与debian中的可用显示错误不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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