[英]Appium driver.find_element() returns Dictionary [Error]
Appium verison: 2.1.4 Appium 版本:2.1.4
Selenium version: 4.0.0 Selenium 版本: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. driver.find_element()返回字典而不是元素 object,因此在执行driver.find_element().click()时会抛出以下错误。
'dict' object has no attribute 'click'
'dict' object 没有属性 'click'
Similar question can be found here and here可以在这里和这里找到类似的问题
But the fix didnt work.但修复没有奏效。 Any help would be appreciated
任何帮助,将不胜感激
A workaround to solve this without updating Appium:在不更新 Appium 的情况下解决此问题的解决方法:
if type(element) is dict:
first_element = list(element.values())[0]
element = driver.create_web_element(element_id=first_element)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.