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

reset_actions() does not seem to work #8776

Closed
peterjv26 opened this issue Oct 12, 2020 · 1 comment
Closed

reset_actions() does not seem to work #8776

peterjv26 opened this issue Oct 12, 2020 · 1 comment
Labels

Comments

@peterjv26
Copy link

🐛 Bug Report

I am seeing an issue similar to the one reported in #6837 (which has been closed).
I tested the code given in #6837, which seems to work now, but there are other situations where reset_actions() does not seem to work.
To reproduce the issue that I am seeing, I modified the code included in #6837 as below

from selenium.webdriver.chrome.options import Options
from selenium import webdriver
from selenium.webdriver import ActionChains

def action_chains_test():
options = Options()
driver = webdriver.Chrome(executable_path=r"C:\Users\Admin\Downloads\chromedriver86_win32\chromedriver.exe",options=options)
driver.get('https://developer.mozilla.org/en-US/')

mouse = ActionChains(driver)

for x in range(3):
    print('Iteration - {iter}'.format(iter=x))
    elem = driver.find_element_by_id('technologies-button')
    mouse.click(elem).perform()
    mouse.reset_actions()
    mouse.pause(2)
    
    elem = driver.find_element_by_id('references-guides-button')
    mouse.click(elem).perform()
    mouse.reset_actions()
    mouse.pause(2)
    
    elem = driver.find_element_by_id('feedback-button')
    mouse.click(elem).perform()
    mouse.reset_actions()
    mouse.pause(2)

       
driver.close()

if name == "main":
action_chains_test()

In this code, I am opening https://developer.mozilla.org/en-US/ and clicking on "Technologies", "References & Guides", "Feedback" at the top of that page, in that order, in a loop of 3 iterations. After clicking on each item, I do reset_actions() to clean up the actions queue.
I was expecting these there items to be clicked 3 items one after the other. But if you run the code, you can see

  1. Each item is clicked many more times than three
  2. Sometimes "Technologies" get clicked after "Reference & Guides" which is not in line with the code
  3. First iteration has fewer clicks, second has few more and the third iteration has even more. So later iterations are having more number of click
    This shows the reset_actions() does not seem to work and the actions get piled up in the queue.

Environment

OS: Windows 10
Browser: Chrome
Browser version: Version 86.0.4240.75 (Official Build) (64-bit)
Browser Driver version: ChromeDriver 86.0.4240.22
Language Bindings version: Python 3.7.6
Selenium Grid version (if applicable): NA

@ghost ghost added the needs-triaging label Oct 12, 2020
@barancev barancev added the C-py label Dec 9, 2020
@AutomatedTester
Copy link
Member

I've had a look at this and it appears to be an issue with ChromeDriver. Please log chromedriver issues with the chromedriver project.

https://sites.google.com/a/chromium.org/chromedriver/help

Please be sure to include a completely reproducible test script for them, without a way to reproduce the issue you are seeing there is no good way for them to fix the problem. A reproducible test script includes a WebDriver script and a link to the page in question. If you can not provide a link, create one using jsfiddle.net

@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants