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

selenium.common.exceptions.WebDriverException #9

Closed
chenweigh opened this issue Jan 16, 2019 · 1 comment
Closed

selenium.common.exceptions.WebDriverException #9

chenweigh opened this issue Jan 16, 2019 · 1 comment

Comments

@chenweigh
Copy link

selenium.common.exceptions.WebDriverException: Message: UnknownError: Cannot release a button when no button is pressed.'UnknownError: Cannot release a button when no button is pressed.' when calling method: [wdIMouse::up]

报错,我确定我的按钮的 id 是唯一的。

action = ActionChains(driver)
        action.click_and_hold(button).perform()
        distance = 250
        track = get_track(distance)
        for i in track:
            action.move_by_offset(xoffset=i, yoffset=0).perform()
            action.release(button).perform()
            time.sleep(0.5)
@qzmone
Copy link

qzmone commented Sep 29, 2019

不要提前释放按钮,等for循环结束释放按钮action.release(button).perform()

@Germey Germey closed this as completed Feb 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants