【问题标题】:Troubleshooting Parse Errors when running robot tests on Plone在 Plone 上运行机器人测试时解决解析错误
【发布时间】:2014-03-09 21:28:30
【问题描述】:

我真的不确定我的设置有什么问题。最近添加了机器人测试,我们已经看到它们在另一个开发人员的 OS X 机器上成功运行。

我正在尝试在安装了 Plone 和 Firefox 的 Ubuntu 机器上运行相同的机器人测试。包是https://github.com/collective/collective.academicprogrammes

我必须将 plone.app.robotframework 添加到我的 develop.cfg 文件的 [test] 部分。 这就是我的 develop.cfg 现在的样子:

[来源]

collective.academicprogrammes = git git@github.com:collective/collective.academicprogrammes.git

[扩建]

测试包 = 集体.academicprogrammes[测试]

扩展 = buildout.cfg

扩展 += 开发者先生

鸡蛋+=

  Products.DocFinderTab
  plone.reload
  collective.academicprogrammes

部分 +=

  test
  diazotools
  zopeskel
  robot

总是结帐=强制 来源 = 来源 自动结帐 = *

[测试]

recipe = zc.recipe.testrunner

默认值 = ['--exit-with-status', '--auto-color', '--auto-progress']

鸡蛋=

  ${buildout:eggs}
  ${buildout:test-packages}

[佐佩斯克尔]

食谱 = zc.recipe.egg

鸡蛋=

  ZopeSkel
  Paste
  PasteDeploy
  PasteScript
  zopeskel.diazotheme
  zopeskel.dexterity
  zest.releaser
  ${buildout:eggs}

[机器人]

食谱 = zc.recipe.egg

鸡蛋=

  Pillow
  ${test:eggs}
  plone.app.robotframework

运行bin/buildout -c develop.cfg 安装所有内容后,我 试图运行bin/test -t robot 我得到以下错误:

文件“parser.pxi”,第 569 行,在 lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:74567) 文件“parser.pxi”,第 650 行,在 lxml.etree._handleParseResult (src/lxml/lxml.etree.c:75458) 文件 “parser.pxi”,第 590 行,在 lxml.etree._raiseParseError (src/lxml/lxml.etree.c:74791)

文件“lxml.etree.pyx”,第 2756 行,在 lxml.etree.fromstring (src/lxml/lxml.etree.c:54726) bash:意外标记附近的语法错误 (' (precise)david@localhost:~/Plone/zeocluster$ File "parser.pxi", line 1571, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:82792) bash: syntax error near unexpected token ... File "parser.pxi", line 1450, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:81590) bash: syntax error near unexpected token('

它的结尾是:

AssertionError:安装失败:WebDriverException:消息:'Can\'t 加载配置文件。配置文件目录:/tmp/tmpqsX6Ky/webdriver-py-profilecopy Firefox 输出:Gtk 消息:加载模块失败 "canberra-gtk-module"\n*** LOG addons.xpi: 启动\n*** LOG addons.xpi: checkForChanges\n*** LOG addons.xpi: 没有变化 找到\n************* *************** ******\n* 调用 xpconnect 包装的 JSObject 产生了这个错误: *\n[异常...“\'[JavaScript 错误:“this.updateDisplay 不是函数”{file:“chrome://browser/content/search/search.xml”行: 83}]\' 调用方法时: [nsIBrowserSearchInitObserver::onInitComplete]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)”位置:“JS框架:: resource://gre/components/nsSearchService.js :: onSuccess :: 行 3257" 数据: 是]\n**********************************\n'

【问题讨论】:

  • 运行以下命令 'sudo apt-get install libcanbe rra-gtk-module' 修复了有关 canberra-gtk-module 的部分错误,但我仍然收到其余错误。

标签: plone robotframework


【解决方案1】:

错误是双重的。这与我安装了一个不包含所有依赖项的轻量级 Linux 操作系统有关。具体来说,我必须安装 libcanberra。 为了在 Ubuntu 上执行此操作,我运行了以下命令“sudo apt-get install libcanberra-gtk-module”。这足以解决有关 canberra-gtk-module 的错误。

第二个问题与使用的 Firefox 版本有关。事实证明,Selenium 2.34 与 Firefox 27(我正在使用的浏览器)不兼容。 看: http://selenium.googlecode.com/git/py/CHANGES

有两种选择,将 Selenium 升级到 2.40.0

针对 Firefox 25 运行机器人浏览器测试。

我选择了 Firefox 25 并在运行测试时使用它。

可以在此处找到有关此问题的相关信息:

http://seleniumsimplified.com/problems-running-webdriver-on-firefox-26/

http://support.mozilla.org/en-US/questions/986545

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-07-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-02-07
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    相关资源
    最近更新 更多