'find_element gives 'dict' object has no attribute 'click' error while testing Windows Desktop app using WinAppDriver

I am new to WinAppDriver and Python and I am trying to automate a windows Desktop application using WinAppDriver in Python. When I try to find an element using find_element(), it returns dictionary rather than an element. And because of that I am unable to perform .click(), .send_keys() on any element. I tried looking up solution online and most of the solutions are suggesting to downgrade selenium and have a up to date ChromeDriver. I tried downgrading my selenium from 4.1.3 to 3.141, but I still got the same error. My ChromeDriver is already up to date. This is a Desktop automation which is using WinAppDriver, so I am not sure how downgrading selenium would help. I believe those solutions are for web application tests. Can someone please help look into it? Thank you!

Please check below information for tools versions

  1. Python 3.10
  2. Selenium 4.1.3 [Checked downgrading got same error]
  3. Appium-Python-Client 2.2.0 [Checked downgrading got same error]
  4. WinAppDriver 1.2.1

signin.click() gives error



Solution 1:[1]

I found the solution, which is to revert Selenium to 3.141.0 by running:

pip install selenium==3.141.0

Source

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1