'Getting an error while sending the "sendkeys" in appium server

In appium server , am trying to send the keys inside the text box , where am facing this trouble

Call to 'sendKeys' failed [element.sendKeys("hello")] Error response status: 12, InvalidElementState - An element command could not be completed because the element is in an invalid state (e.g. attempting to click a disabled element). Selenium error: Cannot set the element to 'hello'. Did you interact with the correct element?

can someone help me on this ?



Solution 1:[1]

Can you share more info . Code snippet would be helpful in your case. And in which platform are you trying this?

INFO : InvalidElementState comes in where when elements either of race condition of appium interaction with elements.

Selenium error: Cannot set the element to 'hello'. Did you interact with the correct element?

This appears when find element value of xpath/id is not correct as well .

Solution 2:[2]

1-Try following may help you in debugging:

driver.pressKey(KeyEvent(AndroidKey.A))

2-Use wait till the element to be clickable or make sure for your element locator

elementToBeClickable()

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 Snehal Gajbhiye
Solution 2 Software Tester at ExpandCart