升级 selenium 3.3.0 后报错解决办法
程序员文章站
2022-04-14 09:49:36
...
升级 selenium 3.3.0 后报错解决办法
sudo pip install --upgrade selenium In [4]: import selenium In [5]: selenium.version Out[5]: '3.3.0'
执行测试时报错如下:
swot@pp:~/pp/superlists$ python manage.py test functional_tests.tests.NewVisitorTest.test_layout_and_styling Creating 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_styling inputbox.location.get('x') + inputbox.size['width']/2, File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webelement.py", line 403, in location new_loc = {"x": round(old_loc['x']), TypeError: 'NoneType' object has no attribute 'getitem' ---------------------------------------------------------------------- Ran 1 test in 4.378s FAILED (errors=1) Destroying test database for alias 'default'...
原因是:Selenium 3.3.0 requires geckodriver 0.15 due to changes in command response values
wget https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz tar xzvf geckodriver-v0.14.0-linux64.tar.gz sudo cp geckodriver /usr/local/bin python manage.py test functional_tests.tests.NewVisitorTest.test_layout_and_styling Creating test database for alias 'default'... . ---------------------------------------------------------------------- Ran 1 test in 5.307s OK Destroying test database for alias 'default'...
参考官网说明:
以上就是升级 selenium 3.3.0 后报错解决办法的详细内容,更多请关注其它相关文章!
推荐阅读
-
升级WAMPSERVER后运行php程序总报错,求助!
-
foxmail7.2怎么导入7.0的邮件备份 升级后旧邮件丢失了的解决办法
-
foxmail7.2怎么导入7.0的邮件备份 升级后旧邮件丢失了的解决办法
-
django修改表数据结构后报错的解决办法
-
yum update 升级报错的解决办法
-
win10浏览器打不开怎么办?升级win10后浏览器打不开问题解决办法
-
win7升级win10之后连不上网怎么办 win7升级win10后网络不能用的三种解决办法
-
Asp.net Core 1.1 升级后操作mysql出错的解决办法
-
github下载下来的项目导入自己的本地后报错修改及配置相关解决办法
-
在Linux中升级Python后不能使用yum命令问题解决办法