I am following guide to learn TDD with python. At some point, after doing migrations, the output of command python3 functional_tests.py
should be (according to book):
self.fail('Finish the test!')
AssertionError: Finish the test!
But I am getting error:
selenium.common.exceptions.InvalidSelectorException: Message: Given css selector expression "tr" is invalid: TypeError: can't access dead object
And after trying second (and more) time:
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.
I've been googling and searching SO for similar problems, but didn't find one that could help me solve the issue.
I am using geckodriver, and adding it's path to PATH
.
Django==1.8.7
selenium==3.0.2
Mozilla Firefox 50.0.2
(X)Ubuntu 16.04
Should I switch to Chrome? It's not trivial, it would require some time from me, but can it work? Is more like Firefox or Selenium? I don't think it's code related - I cloned repo for chapter 5 and same crash is happening.
It's because the book is expecting you to use Selenium 2, not Selenium 3. v3 has quite different behaviour with regards to implicit waits (and quite a few bugs last time I checked) so it's simplest to stick with Selenium 2 for now.
Have another look at the installation instructions: http://www.obeythetestinggoat.com/book/pre-requisite-installations.html