'Appium driver.find_element() returns Dictionary [Error]

Appium verison: 2.1.4
Selenium version: 4.0.0

driver.find_element() returns a dictionary instead of an element object, so while doing driver.find_element().click() the following error is thrown.

'dict' object has no attribute 'click'

Similar question can be found here and here

But the fix didnt work. Any help would be appreciated



Solution 1:[1]

A workaround to solve this without updating Appium:

if type(element) is dict:
    first_element = list(element.values())[0]
    element = driver.create_web_element(element_id=first_element)

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 Nagulan S