硒fedora xfce亚马逊EC2

时间:2013-10-19 11:22:24

标签: python linux selenium selenium-webdriver xfce

我在EC2上运行fedora 19 XFCE,当我运行python selenium脚本时出现此错误...

E
======================================================================
ERROR: test_PROG (__main__.TEST_PROG)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "selenium_asda.py", line 24, in setUp
    self.driver = webdriver.Firefox()
  File "/usr/lib/python2.7/site-packages/selenium-2.36.0-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 60, in __init__
    self.binary, timeout),
  File "/usr/lib/python2.7/site-packages/selenium-2.36.0-py2.7.egg/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/lib/python2.7/site-packages/selenium-2.36.0-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 61, in launch_browser
    self._wait_until_connectable()
  File "/usr/lib/python2.7/site-packages/selenium-2.36.0-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 100, in _wait_until_connectable
    self._get_firefox_output())
WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: \n(process:22490): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0\' failed\nGtk-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/usr/lib/firefox/firefox: relocation error: /tmp/tmpxzNZAo/extensions/fxdriver@googlecode.com/platform/Linux_x86-gcc3/components/libwebdriver-firefox-latest.so: symbol _Znwj, version xul24.0 not defined in file libxul.so with link time reference\n' 

----------------------------------------------------------------------
Ran 1 test in 5.193s

FAILED (errors=1)

该脚本在我的本地计算机上正常工作......我认为这与XFCE的桌面设置有关。

我通过vnc连接到实例,可以毫无问题地获得完整的XFCE桌面。

任何提示?

解决:

我将硒2.36降级到2.35,测试运行正常。

1 个答案:

答案 0 :(得分:2)

该错误是由于浏览器不兼容造成的。尝试运行FF24时,我有同样的事情。尝试使用此处的教程尝试使用FF22运行它。

Firefox browser issues with Selenium