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

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

Open
bwomsm1 opened this issue Sep 4, 2022 · 31 comments

Comments

@bwomsm1
Copy link

bwomsm1 commented Sep 4, 2022

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
Copy link
Author

bwomsm1 commented Sep 4, 2022

@Shakevg can you please help with that issue?

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 4, 2022

@anunay1

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 4, 2022

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.

@liljohnak
Copy link

#1686 (comment)

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 4, 2022

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

@liljohnak
Copy link

liljohnak commented Sep 4, 2022

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.

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 4, 2022

@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
- windows@2.0.7 [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
Copy link
Author

bwomsm1 commented Sep 6, 2022

@liljohnak can you please advise on that issue?
thanks

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 6, 2022

@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

@anunay1
Copy link

anunay1 commented Sep 6, 2022

@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
Copy link

anunay1 commented Sep 6, 2022

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

@anunay1
Copy link

anunay1 commented Sep 6, 2022

more information can be found at

@Anna-Ku
Copy link

Anna-Ku commented Sep 11, 2022

@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

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 11, 2022

@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.

@anunay1
Copy link

anunay1 commented Sep 11, 2022

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

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 11, 2022

:) 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?

@anunay1
Copy link

anunay1 commented Sep 11, 2022

@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
Copy link

anunay1 commented Sep 11, 2022

@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?

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 11, 2022

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.

@anunay1
Copy link

anunay1 commented Sep 11, 2022

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

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 11, 2022

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?

@anunay1
Copy link

anunay1 commented Sep 11, 2022

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.

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 11, 2022

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?

@liljohnak
Copy link

liljohnak commented Sep 11, 2022 via email

@bwomsm1
Copy link
Author

bwomsm1 commented Sep 13, 2022

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

@paul-foreflight
Copy link

paul-foreflight commented Sep 21, 2022

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.

@bwomsm1
Copy link
Author

bwomsm1 commented Oct 25, 2022

@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
Copy link
Author

bwomsm1 commented Oct 25, 2022

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?

@liljohnak
Copy link

Per @DHowett:
#1610 (comment) 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.

@DHowett
Copy link
Member

DHowett commented Oct 25, 2022

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

@bwomsm1
Copy link
Author

bwomsm1 commented Oct 26, 2022

@liljohnak @DHowett thank you both, I will follow on both this thread and #1610 for updates.
I am pushing since this issue really blocks us from investing in Windows Apps automation.

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

6 participants