WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

"WebDriver' object has no attribute 'w3c'" error is raised when using ActionChains

Open bwomsm1 opened this issue 3 years ago • 26 comments

I am tying to call to ActionChains method called move_to_element, but fortunately error is raised after a successful alloc of ActionChains: AttributeError: 'WebDriver' object has no attribute 'w3c'
My python libs are: Appium-Python-Client==2.4.1 selenium==3.141.0

Capabilities:

app = <path to my app>
winAppDriverHost = 127.0.0.1:4723

platformName = Windows

platformVersion = 10

automationName = Windows

appArguments = <my app args>

appWorkingDir = <my app working dir>

bwomsm1 avatar Sep 04 '22 07:09 bwomsm1

@Shakevg can you please help with that issue?

bwomsm1 avatar Sep 04 '22 07:09 bwomsm1

@anunay1

bwomsm1 avatar Sep 04 '22 08:09 bwomsm1

The WinAppDriver version which I am using is 1.2.1.0, I also tried with 1.2.99 but I got the same error.

bwomsm1 avatar Sep 04 '22 09:09 bwomsm1

https://github.com/microsoft/WinAppDriver/issues/1686#issuecomment-1048632954

liljohnak avatar Sep 04 '22 14:09 liljohnak

@liljohnak what do you mean by saying downgrade the Appium version to 4.3.1? Appium latest version is 1.22.3

bwomsm1 avatar Sep 04 '22 14:09 bwomsm1

Current 5.0 Appium is using w3c. It is a TODO for the next WinAppDriver release. To fix your problem you'll need to downgrade.

liljohnak avatar Sep 04 '22 15:09 liljohnak

@liljohnak sorry, but I am not sure I understood your answer, when I type appium --version I get 2.0.0-beta.43.

When I type appium driver list I get:

- Listing available drivers
√ Listing available drivers
- [email protected] [installed (NPM)]
- uiautomator2 [not installed]
- xcuitest [not installed]
- youiengine [not installed]
- mac [not installed]
- mac2 [not installed]
- espresso [not installed]
- tizen [not installed]
- flutter [not installed]

The driver of what you are referring to?

Thanks!

bwomsm1 avatar Sep 04 '22 17:09 bwomsm1

@liljohnak can you please advise on that issue? thanks

bwomsm1 avatar Sep 06 '22 04:09 bwomsm1

@liljohnak coding lang is Python, and my current webdriver (wd) is 1.14.0, I was installing it with npm. I tried version 1.12.1 but it did not help, same error

bwomsm1 avatar Sep 06 '22 07:09 bwomsm1

@liljohnak Python client does not have any 5 version, that is only for C#. @bwomsm1 please downgrade the appium python client to version 2.3.0 and check. Also what argument are you passing in the action chain webelement or driver.

anunay1 avatar Sep 06 '22 09:09 anunay1

I think you need to downgrade to appium version 1. image

anunay1 avatar Sep 06 '22 09:09 anunay1

more information can be found at

anunay1 avatar Sep 06 '22 10:09 anunay1

@anunay1 tried as you suggested but I'm getting the following error message:

failed: ModuleNotFoundError: No module named 'selenium.webdriver.common.options'

Python modules: Appium-Python-Client==2.3.0 selenium==3.141.0

Please advise how to proceed

Anna-Ku avatar Sep 11 '22 11:09 Anna-Ku

@anunay1 downgrading to appium 1.3.0 or 2.3.0 did not solve the issue, when downgrading to these low releases I am getting errors that some webdriver libraries are not supported, like AppiumBy or options, my framework is based on these libs.

Can you please advise? Thanks.

bwomsm1 avatar Sep 11 '22 12:09 bwomsm1

@bwomsm1 It sounds stupid but can you try uninstalling and reinstalling the python appium client.

anunay1 avatar Sep 11 '22 14:09 anunay1

:) not stupid at all, I think I understand why you are saying so.
I tried this as well, but it did not help. I have a feeling that is has to do with my setuptools==65.3.0 version, does this version is correct?

bwomsm1 avatar Sep 11 '22 14:09 bwomsm1

@bwomsm1 Can you please check from appium.webdriver.common.touch_action import TouchAction import the library

    actions = TouchAction(driver)
    actions.move_to(ele).perform()
    actions.tap(ele)
image

anunay1 avatar Sep 11 '22 15:09 anunay1

@anunay1 tried as you suggested but I'm getting the following error message:

failed: ModuleNotFoundError: No module named 'selenium.webdriver.common.options'

Python modules: Appium-Python-Client==2.3.0 selenium==3.141.0

Please advise how to proceed

For what purpose you need this module?

anunay1 avatar Sep 11 '22 16:09 anunay1

from appium.webdriver.common.touch_action import TouchAction import the library

@anunay1 with TouchAction it did work :-) but not exactly to what I was referring to. I wanted to move the mouse pointer to some element, your suggestion did work but also performed click on the element. I also tried with removing the last line actions.tap(ele)

What is the rule here? when do I use TouchAction and when ActionChains as far as I know TouchAction is for Appium and mobile.

bwomsm1 avatar Sep 11 '22 16:09 bwomsm1

There is no rule as such, this is just a work around unless win app driver is W3C compliant

anunay1 avatar Sep 11 '22 18:09 anunay1

There is no rule as such, this is just a work around unless win app driver is W3C compliant

ok, but still I was not able to perform "mouse pointer move" with TouchAction, it seems like I still need ActionChains. Are you able to use ActionChains on your local?

bwomsm1 avatar Sep 11 '22 18:09 bwomsm1

I don't understand what you are referring to, you need to move to the element and click the element or else something else or just move to the element.

anunay1 avatar Sep 11 '22 18:09 anunay1

Just move the mouse on some element, without clicking. My test case is that I have some element that once the mouse is on it, a popover is being presented, I would like to simulate that case. Screen Shot 2022-09-11 at 21 54 24 For example the text "Click or press alt+enter", it's showing only when a mouse is on some element

In addition, I am not sure how I can perform right click with TouchAction?

bwomsm1 avatar Sep 11 '22 18:09 bwomsm1

S @.***

Sent from my Galaxy

-------- Original message -------- From: ANUNAYA THAKUR @.> Date: 9/11/22 8:35 AM (GMT-08:00) To: microsoft/WinAppDriver @.> Cc: Jonathan Neal @.>, Mention @.> Subject: Re: [microsoft/WinAppDriver] "WebDriver' object has no attribute 'w3c'" error is raised when using ActionChains (Issue #1784)

@bwomsm1https://github.com/bwomsm1 Can you please check from appium.webdriver.common.touch_action import TouchAction import the library

actions = TouchAction(driver)
actions.move_to(ele).perform()
actions.tap(ele)

— Reply to this email directly, view it on GitHubhttps://github.com/microsoft/WinAppDriver/issues/1784#issuecomment-1242989476, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE6MNO4IGJC2URDVVVZU36DV5X32VANCNFSM6AAAAAAQEGQRQU. You are receiving this because you were mentioned.Message ID: @.***>

liljohnak avatar Sep 11 '22 18:09 liljohnak

@anunay1 @liljohnak any updates about this ticket? Can we say that currently ActionChains is not supported for WinAppDriver testing?

bwomsm1 avatar Sep 13 '22 13:09 bwomsm1

So I've spent entirely too long working on this, you'll need to move back to at least appium-python-client 1.3.0 and selenium 3.14.1. You'll need to revert your AppiumBy back to MobileBy and options back to desired capabilities. They've completely removed the ability to use the old json format in the new versions and you won't be able to upgrade one without the other (some converters have been completely ripped out)

Hopefully when they one day update the WinAppDriver it'll support the new w3c standard.

paul-foreflight avatar Sep 21 '22 04:09 paul-foreflight

@anunay1 any news about this ticket? As I said in the past I cannot downgrade to older versions of Python. Are you guys about to solve the w3c issue?

bwomsm1 avatar Oct 25 '22 19:10 bwomsm1

Current 5.0 Appium is using w3c. It is a TODO for the next WinAppDriver release. To fix your problem you'll need to downgrade.

@liljohnak can you share when the next release with w3c fix will be available?

bwomsm1 avatar Oct 25 '22 19:10 bwomsm1

Per @DHowett: https://github.com/microsoft/WinAppDriver/issues/1610#issuecomment-944544522 fix is in the works... But, this project had a fast start and now hasn't had any updates since. @DHowett could get us a better guess than I can.

liljohnak avatar Oct 25 '22 21:10 liljohnak

(This is in a shelved changeset on my machine, as things have been unexpectedly busy since I started working on it.)

DHowett avatar Oct 25 '22 21:10 DHowett