selenium and web2py from killer-web-development.com doesn't work

余生长醉 提交于 2019-12-13 19:06:54

问题


I am trying to follow the tutorial on http://killer-web-development.com/section/4/3 and I am running into the error message:

    ======================================================================
ERROR: setUpClass (test_static_pages.TestHomePage)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Applications/web2py.app/Contents/Resources/applications/tukker/functional_tests.py", line 18, in setUpClass
    self.browser = webdriver.Firefox()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 51, in __init__
    self.binary, timeout),
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 46, in __init__
    self.binary.launch_browser(self.profile)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 44, in launch_browser
    self._wait_until_connectable()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 86, in _wait_until_connectable
    self.profile.path, self._get_firefox_output()))
WebDriverException: Message: 'Can\'t load the profile. Profile Dir: /tmp/tmpXWOMML Firefox output: 1409783847270\taddons.manager\tDEBUG\tLoaded provider scope for resource://gre/modules/addons/XPIProvider.jsm: ["XPIProvider"]\n1409783847271\taddons.manager\tDEBUG\tLoaded provider scope for resource://gre/modules/LightweightThemeManager.jsm: ["LightweightThemeManager"]\n1409783847272\taddons.xpi\tDEBUG\tstartup\n1409783847273\taddons.xpi\tDEBUG\tSkipping unavailable install location app-system-share\n1409783847283\taddons.xpi\tDEBUG\tcheckForChanges\n1409783847286\taddons.xpi\tDEBUG\tNo changes found\nJavaScript error: chrome://browser/content/urlbarBindings.xml, line 674: aUrl is undefined\n' 

What is wrong? I am on MacOsX maverics and have installed selenium using macports if that is of any help.


回答1:


The reason you have problems is because you have a brand new browser and an old selenium.

You need to do two things:

  • upgrade selenium package to the latest (currently 2.42.1) version
  • downgrade Firefox to 28 version


来源:https://stackoverflow.com/questions/25654761/selenium-and-web2py-from-killer-web-development-com-doesnt-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!