Selenium webdriver 未知错误:键码转换需要X显示

Selenium webdriver 未知错误:键码转换需要X显示,selenium-webdriver,appium,xvfb,Selenium Webdriver,Appium,Xvfb,我正在尝试在Centos 6上使用appium运行移动web测试,但我不断遇到以下错误: "info: [CHROMEDRIVER STDERR] No protocol specified info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":

我正在尝试在Centos 6上使用appium运行移动web测试,但我不断遇到以下错误:

"info: [CHROMEDRIVER STDERR] No protocol specified

info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"**unknown error: an X display is required for keycode conversions, consider using Xvfb\n**  (Session info: chrome=webview)\n  (Driver info:chromedriver=2.9.248316,platform=Linux 2.6.32-042stab088.4x86_64)"},"sessionId":"8563fbe5972f3ba87673c7a082d49d22"}
POST /wd/hub/session/8563fbe5972f3ba87673c7a082d49d22/element/0.06753459526225924-1/value 500 1927ms - 395b

debug: Appium request initiated at /wd/hub/session/8563fbe5972f3ba87673c7a082d49d22

debug: Request received with params: {}

info: Shutting down appium session..."

它打开chrome浏览器并导航到给定的url。之后,它尝试将密钥发送到用户名字段,但失败

请在此处找到可能的解决方案:

它在Ubuntu上适用于我,也许类似的解决方案在CentOS上也适用。 出于某种原因,我不得不用更大的帧缓冲区启动Xvfb

sudo Xvfb :10 -ac -screen 0 4000x2000x8

您需要使用
xvfb run
来包装Appium服务器调用,否则Appium将无法使用xvfb服务器:

xvfb-run appium <server switches>
xvfb运行应用程序

您解决了这个问题吗?我也面临同样的问题。你能帮忙吗?