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

AttributeError: move_to requires a WebElement #116

Open
M-Fahad opened this issue Jul 19, 2023 · 1 comment
Open

AttributeError: move_to requires a WebElement #116

M-Fahad opened this issue Jul 19, 2023 · 1 comment

Comments

@M-Fahad
Copy link

M-Fahad commented Jul 19, 2023

Hello team,

I am just running the example code you provided in the example

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from random import randint
import time
import utilities

driver = utilities.startWebDriverSession('http://localhost:4622/wd/hub')

driver.get("calculator")
time.sleep(10)

driver.add_cookie({'name': 'mouse_speed', 'value': 40})

def clickElement(xPath):
    element = driver.find_element(By.XPATH, xPath)
    ActionChains(driver).move_to_element(element).click().perform()

#AC
clickElement("/AXApplication[@AXTitle='Calculator']/AXWindow[@AXIdentifier='_NS:437' and @AXSubrole='AXStandardWindow']/AXGroup[@AXIdentifier='_NS:336']/AXButton[@AXTitle='6' and @AXIdentifier='_NS:459']")

But receiving the error code mentioned below. Can you please help me to fix this problem?

Traceback (most recent call last):
  File "/Users/upgenics/Desktop/appium-for-mac-master/examples/SeleniumConf April 2017/new.py", line 24, in <module>
    clickElement("/AXApplication[@AXTitle='Calculator']/AXWindow[@AXIdentifier='_NS:437' and @AXSubrole='AXStandardWindow']/AXGroup[@AXIdentifier='_NS:336']/AXButton[@AXTitle='6' and @AXIdentifier='_NS:459']")
  File "/Users/upgenics/Desktop/appium-for-mac-master/examples/SeleniumConf April 2017/new.py", line 21, in clickElement
    ActionChains(driver).move_to_element(element).click().perform()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/common/action_chains.py", line 252, in move_to_element
    self.w3c_actions.pointer_action.move_to(to_element)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/selenium/webdriver/common/actions/pointer_actions.py", line 59, in move_to
    raise AttributeError("move_to requires a WebElement")
AttributeError: move_to requires a WebElement
@eglitise
Copy link

This driver is not supported anymore. Consider switching to appium-mac2-driver.

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

2 participants