重庆小潘seo博客

当前位置:首页 > 重庆网络营销 > 小潘杂谈 >

小潘杂谈

升级 selenium 3.3.0 后报错解决办法

时间:2020-09-11 03:30:05 作者:重庆seo小潘 来源:
升级 selenium 3.3.0 后报错解决办法sudo pip install --upgrade seleniumIn [4]: import seleniumIn [5]: selenium.versionOut[5]: 3.3.0执行测试时报错如下:swot@pp:~/pp/superlists$ python manage.py test functional_tests.tests.NewVisitorTest.test_

升级 selenium 3.3.0 后报错解决办法sudo pip install --upgrade seleniumIn [4]: import seleniumIn [5]: selenium.versionOut[5]: '3.3.0'执行测试时报错如下:swot@pp:~/pp/superlists$ python manage.py test functional_tests.tests.NewVisitorTest.test_layout_and_stylingCreating test database for alias 'default'...E======================================================================ERROR: test_layout_and_styling (functional_tests.tests.NewVisitorTest)----------------------------------------------------------------------Traceback (most recent call last):File "/home/swot/pp/superlists/functional_tests/tests.py", line 123, in test_layout_and_stylinginputbox.location.get('x') + inputbox.size['width']/2,File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 403, in locationnew_loc = {"x": round(old_loc['x']),TypeError: 'NoneType' object has no attribute 'getitem'----------------------------------------------------------------------Ran 1 test in 4.378sFAILED (errors=1)Destroying test database for alias 'default'...原因是:Selenium 3.3.0 requires geckodriver 0.15 due to changes in command response valueswget https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gztar xzvf geckodriver-v0.14.0-linux64.tar.gzsudo cp geckodriver /usr/local/binpython manage.py test functional_tests.tests.NewVisitorTest.test_layout_and_stylingCreating test database for alias 'default'....----------------------------------------------------------------------Ran 1 test in 5.307sOKDestroying test database for alias 'default'...参考官网说明:

升级 selenium 3.3.0 后报错解决办法以上就是升级 selenium 3.3.0 后报错解决办法的详细内容,更多请关注小潘博客其它相关文章!