Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python method ActionChains.pause implemented incorrectly #4795

Closed
AlexNk opened this issue Oct 2, 2017 · 1 comment
Closed

Python method ActionChains.pause implemented incorrectly #4795

AlexNk opened this issue Oct 2, 2017 · 1 comment

Comments

@AlexNk
Copy link

AlexNk commented Oct 2, 2017

Meta -

OS: Linux

Selenium Version: 3.6.0

Browser: Firefox

Browser Version: 55.0.2

Expected Behavior -

ActionChains.pause to work as described in documentation.

Actual Behavior -

Steps to reproduce -

The following code

from selenium import webdriver`
from selenium.webdriver import ActionChains`
from selenium.webdriver.common.keys import Keys`

driver = webdriver.Firefox()
driver.get("http://www.google.com")
elem = driver.find_element_by_name("q")
actions = ActionChains(driver)
actions.key_down(Keys.CONTROL, elem)
actions.pause(1)
actions.key_up(Keys.CONTROL, elem)
actions.perform()
driver.close()

generates the following error:

Traceback (most recent call last):
  File "/media/work/_Down/coding/test.py", line 21, in <module>
    actions.pause(1)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/common/action_chains.py", line 319, in pause
    self.w3c_actions.pointer_action.pause(self, seconds)
TypeError: pause() takes from 1 to 2 positional arguments but 3 were given

which is likely caused by copy-paste:

    def pause(self, seconds):
        if self._driver.w3c:
            self.w3c_actions.pointer_action.pause(self, seconds)
            self.w3c_actions.key_action.pause(self, seconds)
        else:
            self._actions.append(lambda: self._driver.execute(
                time.sleep(seconds)
            ))
        return self
@lmtierney
Copy link
Member

Fixed in 5e6b0c9, will be in the next release. Thanks for the bug report!

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants