appium / python-client

Python language bindings for Appium
Apache License 2.0
1.67k stars 561 forks source link

Hover on element is not working #888

Open pppppino opened 1 year ago

pppppino commented 1 year ago

Environment: Appium-Python-Client 2.11.1 Windows desktop app, My Env is Ok, since I have done many automation work

I want to hover on element, I have tried: ActionChains(self.driver).move_to_element(ele).perform(),
I got an exception: > raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace)) E selenium.common.exceptions.UnknownMethodException: Message: Currently only pen and touch pointer input source types are supported E Stacktrace: E UnsupportedOperationError: Currently only pen and touch pointer input source types are supported

then I tried: TouchAction(self.driver).move_to(ele).perform(), I found it directly click the target instead of hover on it!

then I tried: ActionChains(self.driver).w3c_actions.pointer_action.move_to(ele), and it do not work

Is there any other method to achieve this?

KazuCocoa commented 1 year ago

Maybe you need to use touch input like https://github.com/appium/python-client/blob/b142e00e3f47065752c80f71f2f8cb80bf2500f7/appium/webdriver/extensions/action_helpers.py#L49-L61 for the env. I guess your code sent mouse .

mykola-mokhnach commented 1 year ago

@KazuCocoa I assume touch pointers do not have a "hover" concept. Only mouse does it

pppppino commented 1 year ago

@KazuCocoa I have tried it, but it not works