我正在遵循使用 python 学习 TDD 的指南。在某些时候,在进行迁移之后,命令的输出python3 functional_tests.py
应该是(根据书):
self.fail('Finish the test!')
AssertionError: Finish the test!
但我收到错误:
selenium.common.exceptions.InvalidSelectorException: Message: Given css selector expression "tr" is invalid: TypeError: can't access dead object
在尝试第二次(以及更多)时间之后:
selenium.common.exceptions.StaleElementReferenceException: Message: The element reference is stale. Either the element is no longer attached to the DOM or the page has been refreshed.
我一直在谷歌搜索和搜索类似的问题,但没有找到可以帮助我解决问题的问题。
我正在使用 geckodriver,并将其路径添加到PATH
.
Django==1.8.7
selenium==3.0.2
Mozilla Firefox 50.0.2
(X)Ubuntu 16.04
我应该切换到 Chrome 吗?这不是微不足道的,它需要我一些时间,但它可以工作吗?更像 Firefox 还是 Selenium?我认为这与代码无关 - 我为第 5 章克隆了 repo,并且发生了同样的崩溃。