Search code examples
seleniumselenium-webdriverautomationappiumselenium-chromedriver

Appium throwing error while trying to enter values via sendKeys method


I am trying to pass the text value via sendKeys method, but while running the test case it fails.

Control comes till the text box element, does a click operation (Mobile Keyboard is opened). But after this when I am trying to pass value to Text box using sendKeys method I get the below error

org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=66.0.3359.126)
(Driver info: chromedriver=2.30.477700 
(0057494ad8732195794a7b32078424f92a5fce41),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)

The same code works for Android devices below 5 (Lolypop), but after Lolypop version I get the above error.

Below is the sample code of how I am trying to pass the data to text box

MobileElement elUserName = (MobileElement) driver.findElement(new By.ById("loginUserName"));
elUserName.click();
elUserName.sendKeys("MobileTest"); // ------- It fails at this point

Solution

  • I could resolve the issue by following the below steps

    1. Download the latest ChromeDriver from this link.
    2. Download suitable chromeDriver based on the machine.
    3. Save the downloaded file in a location and provide the same location in Appium (Chrome driver location)
    4. Add update Android Web View on the test phone to the latest version.

    This solved my problem. Hope this helps others also.