Question

I'm really not sure what's wrong with my setup. The robot tests were added recently and we've seen them run successfully on another developer's OS X machine.

I'm attempting to run the same robot tests on an Ubuntu machine with Plone and Firefox installed. The package is https://github.com/collective/collective.academicprogrammes

I had to add plone.app.robotframework to the [test] section of my develop.cfg file. This is what my develop.cfg looks like now:

[sources]

collective.academicprogrammes = git git@github.com: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

After running bin/buildout -c develop.cfg to install everything I attempted to run bin/test -t robot I get the following errors:

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)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('

And it ends with:

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'

Was it helpful?

Solution

The error is two-fold. One has to do with the fact that I installed a lightweight Linux OS that didn't include all the dependencies. Specifically I had to install libcanberra. To do this on Ubuntu I ran the following command 'sudo apt-get install libcanberra-gtk-module'. That was enough to fix the error about canberra-gtk-module.

The second issue was related to the version of Firefox used. It turns out that Selenium 2.34 is not compatible with Firefox 27 (the browser I'm using). see: http://selenium.googlecode.com/git/py/CHANGES

There are two options, upgrade Selenium to 2.40.0

OR

run robot browser tests against Firefox 25.

I opted to get Firefox 25 and use it when running tests.

Related information about this issue can be found here:

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top