Skip to content

[🐛 Bug]: move_to_element_with_offset(element, 0, 0) is clicking at the middle of the element. #10261

@petrisorureche

Description

@petrisorureche

What happened?

move_to_element_with_offset(element, 0, 0) is clicking at the middle of the element.

How can we reproduce the issue?

from selenium import webdriver

from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By


def test_click_top_left_selenium():
    driver = webdriver.Chrome()
    driver.get("file:///C:/Users/user/Desktop/GitHub/selenium-python-helium/tests/api/data/test_point.html")
    el = driver.find_element(By.XPATH, "//button[text()='Button 1']")
    action = ActionChains(driver)
    action.move_to_element_with_offset(el, 0, 0)
    action.click()
    action.perform()
    assert driver.find_element(By.ID, "result").text == "Button 1 clicked at offset (0, 0)."

Relevant log output

n/a

Operating System

Windows 10

Selenium version

Python 3.9

What are the browser(s) and version(s) where you see this issue?

Chrome 97

What are the browser driver(s) and version(s) where you see this issue?

Chromedriver 97

Are you using Selenium Grid?

Python Selenium 4.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!I-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions