python-needle / needle

Automated tests for your CSS.
https://needle.readthedocs.io/
Other
590 stars 50 forks source link

WebDriverException on clean install #58

Open Naimadnap opened 7 years ago

Naimadnap commented 7 years ago

I try to run simple test from /test directory and I get an error like

~/needle/tests$ nosetests3 test_driver.py --with-save-baseline
...EE
======================================================================
ERROR: test_get_dimensions (tests.test_driver.TestWebElement)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/damian/needle/tests/test_driver.py", line 47, in test_get_dimensions
    self.assertEqual(e.get_dimensions(), {
  File "/usr/local/lib/python3.5/dist-packages/needle/driver.py", line 44, in get_dimensions
    location = self.location
  File "/home/damian/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webelement.py", line 402, in location
    old_loc = self._execute(Command.GET_ELEMENT_LOCATION)['value']
  File "/home/damian/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webelement.py", line 494, in _execute
    return self._parent.execute(command, params)
  File "/home/damian/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/home/damian/.local/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: GET /session/cd8c0384-21b8-49a4-8493-e7dd682e33cf/element/85d8038e-6e97-4c88-b62f-672cca2f95be/location did not match a known command
jphalip commented 7 years ago

To me this looks like a potential bug with Selenium itself. Which version of Selenium are you using, and have you tried upgrading to the latest version?

Naimadnap commented 7 years ago

Selenium 3.0.2 version Firefox in 50.1 python 2.7.12 and 3.5.2 nosetest 1.3.7 ubuntu 16.04 on virtual box

jphalip commented 7 years ago

Thanks. My gut feeling is that it's a bug with the Selenium package with regard to Firefox. I haven't had a chance to test firsthand yet though. On a side note, it'd be useful to add Firefox to the Travis test matrix — I've created a separate issue for that in #60.

cgoldberg commented 7 years ago

this is not going to work in firefox using geckodriver, since the Actions class is yet to be implemented. I think the only temporary solution would be to use selenium 2.x

monsonjeremy commented 7 years ago

Ran into this issue, this is related to a bug with Geckodriver and Selenium: https://github.com/mozilla/geckodriver/issues/548 https://github.com/mozilla/geckodriver/issues/159

A temporary fix for this issue is to downgrade to Selenium 2.53.6 and firefox 45.6. There may be other version combinations that work but in the meantime these have worked for me.

jmbowman commented 7 years ago

This should be fixed with the code now in master (support was added for Geckodriver and recent Firefox versions).