我在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/[email protected]/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桌面。

有什么提示吗?

已解决:

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

最佳答案

该错误是由于浏览器不兼容引起的。尝试运行FF24时,我遇到了同样的事情。在这里尝试本教程,尝试使其与FF22一起运行。

Firefox browser issues with Selenium

关于python - Selenium 软呢帽xfce亚马逊EC2,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19465516/

10-11 02:04