2014-03-05 19 views
2

我真的不確定我的設置有什麼問題。機器人測試最近被添加,我們已經看到它們在另一個開發人員的OS X機器上成功運行。疑難解答在Plone上運行機器人測試時解析錯誤

我試圖在安裝了Plone和Firefox的Ubuntu機器上運行相同的機器人測試。包是https://github.com/collective/collective.academicprogrammes

我不得不將plone.app.robotframework添加到我的develop.cfg文件的[test]部分。 這是我的develop.cfg貌似現在:

[sources]

collective.academicprogrammes = git [email protected]:collective/collective.academicprogrammes.git

[buildout]

test-packages = collective.academicprogrammes[test]

extends = buildout.cfg

extensions += mr.developer

eggs +=

Products.DocFinderTab 
    plone.reload 
    collective.academicprogrammes 

parts +=

test 
    diazotools 
    zopeskel 
    robot 

always-checkout = force sources = sources auto-checkout = *

[test]

recipe = zc.recipe.testrunner

defaults = ['--exit-with-status', '--auto-color', '--auto-progress']

eggs =

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

[zopeskel]

recipe = zc.recipe.egg

eggs =

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

[robot]

recipe = zc.recipe.egg

eggs =

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

運行bin/buildout -c develop.cfg安裝一切後,我 試圖運行bin/test -t robot我得到以下錯誤:

File "parser.pxi", line 569, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/lxml.etree.c:74567) File "parser.pxi", line 650, in lxml.etree._handleParseResult (src/lxml/lxml.etree.c:75458) File "parser.pxi", line 590, in lxml.etree._raiseParseError (src/lxml/lxml.etree.c:74791)

File "lxml.etree.pyx", line 2756, in lxml.etree.fromstring (src/lxml/lxml.etree.c:54726) bash: syntax error near unexpected token (' (precise)[email protected]:~/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: Setup failed: WebDriverException: Message: 'Can\'t load the profile. Profile Dir: /tmp/tmpqsX6Ky/webdriver-py-profilecopy Firefox output: Gtk-Message: Failed to load module "canberra-gtk-module"\n*** LOG addons.xpi: startup\n*** LOG addons.xpi: checkForChanges\n*** LOG addons.xpi: No changes found\n**********************************\n* Call to xpconnect wrapped JSObject produced this error: *\n[Exception... "\'[JavaScript Error: "this.updateDisplay is not a function" {file: "chrome://browser/content/search/search.xml" line: 83}]\' when calling method: [nsIBrowserSearchInitObserver::onInitComplete]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS frame :: resource://gre/components/nsSearchService.js :: onSuccess :: line 3257" data: yes]\n**********************************\n'

+0

運行以下命令 '命令和apt-get安裝libcanbe RRA-GTK模塊' 修復的部分關於canberra-gtk-module的錯誤,但我仍然得到了其餘的錯誤。 –

回答

3

錯誤是雙重的。其中一個原因是我安裝了一個輕量級的Linux操作系統,它沒有包含所有的依賴關係。具體來說,我不得不安裝libcanberra。 要在Ubuntu上這樣做,我運行了以下命令'sudo apt-get install libcanberra-gtk-module'。這足以解決有關堪培拉-gtk模塊的錯誤。

第二個問題與使用的Firefox版本有關。事實證明,Selenium 2.34與Firefox 27(我正在使用的瀏覽器)不兼容。 看到: http://selenium.googlecode.com/git/py/CHANGES

有兩種選擇,升級硒對抗火狐25 2.40.0

OR

運行機器人瀏覽器測試

我選擇讓火狐25,並用它運行測試時。

有關此問題的相關信息可以在這裏找到:

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

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