我正在尝试使用Centos 6 无头linux 上的appium进行移动网络测试,但我一直收到此错误:
"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。之后,它会尝试sendKeys
到用户名字段,然后失败。
答案 0 :(得分:1)
请在此处找到可能的解决方案: http://www.installationpage.com/selenium/how-to-run-selenium-headless-firefox-in-ubuntu/
它适用于Ubuntu,也许类似的解决方案适用于CentOS。 对于一些共鸣,我不得不用更大的帧缓冲启动Xvfb
sudo Xvfb :10 -ac -screen 0 4000x2000x8
答案 1 :(得分:1)
您需要使用xvfb-run
来包装Appium服务器调用,否则Appium将无法使用Xvfb服务器:
xvfb-run appium <server switches>