python-needle / needle

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

AttributeError: 'NeedleWebDriver' object has no attribute 'set_window_position' #6

Closed dbdr closed 10 years ago

dbdr commented 11 years ago

Hi,

I tried to use needle following the instructions on: http://needle.readthedocs.org/en/latest/

This is what I get:

╰─➤  nosetests test_bbc.py --with-needle-capture                                                                                                                                         1 ↵
E
======================================================================
ERROR: test suite for <class 'test_bbc.BBCNewsTest'>
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 208, in run
    self.setUp()
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 291, in setUp
    self.setupContext(ancestor)
  File "/usr/local/lib/python2.7/dist-packages/nose/suite.py", line 314, in setupContext
    try_run(context, names)
  File "/usr/local/lib/python2.7/dist-packages/nose/util.py", line 469, in try_run
    return func()
  File "/usr/local/lib/python2.7/dist-packages/needle-0.0.1-py2.7.egg/needle/cases.py", line 52, in setUpClass
    cls.driver.set_window_position(0, 0)
AttributeError: 'NeedleWebDriver' object has no attribute 'set_window_position'
-------------------- >> begin captured logging << --------------------
selenium.webdriver.remote.remote_connection: DEBUG: POST http://127.0.0.1:4444/wd/hub/session {"sessionId": null, "desiredCapabilities": {"browserName": "firefox"}}
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 0 tests in 2.925s

FAILED (errors=1)

Am I doing something wrong?

By the way, the docs say: "Download selenium-server-standalone-2.8.0.jar. By default, Selenium requires Firefox 4." so I tried with those versions (and recent versions too). Is this a hard requirement or are newer versions supported too?

dbdr commented 11 years ago

Update, I managed to get it to work after:

diff --git a/requirements.txt b/requirements.txt
index 2934290..2734adb 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
 nose>=1.0.0
-selenium==2.8.1
+selenium==2.33.0
 unittest2==0.5.1
 PIL
niveus commented 11 years ago

Thanks. That worked for me too

jphalip commented 10 years ago

The new version of Needle doesn't require using the Selenium server any more. If you still face similar issues using WebDriver, make sure to update your 'selenium' package to its latest version for good measure.