Tag Archives: Message: Cannot set the element to ‘XXXX’. Did you interact with the correct element?

[Solved] appium Error: Message: Cannot set the element to ‘XXXX’. Did you interact with the correct element?

appium+python+android

There was a problem locating the module input

send_Keys error

Appium reports an error message: cannot set the element to ‘XXXX’. Did you interact with the correct element?

I checked the information and said it was due to the module attribute of Android

The module attribute that can be entered is android.widget.edittext

However, because the module attribute I need to enter is not this attribute, send_ Keys failed

Also tried get_Value() and other input methods are not feasible

Currently, no method is found to use send_keys, Look at what others say you can locate through uiautomator (you can try if you haven’t tried)

At present, the place I encounter is login, so I use driver.press_Keycode() method, input through Unicode keyboard, but presskeycode needs key code, which is more troublesome.

The following is the positioning and use of uiautomator given by netizens

driver.find_element_by_android_uiautomator('new UiSelector().text("Positioning Properties")').send_keys('Input content')