Search code examples
appiumappium-android

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'


I'm automating a web app in chrome browser in Android Mobile. I've ADV with version 7.0

I'm trying to send user name for login using below code -

driver = new AppiumDriver<WebElement>(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.get("https://site-url/");
driver.findElement(By.id("email")).sendKeys("myemailid@gmail.com")

It throws below exception -

Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value' (Session info: chrome=71.0.3578.99) (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds

Note: please don't mark it as duplicate. solution from below references are not working for me.

  1. org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'

  2. Selenium WebDriverException: unknown error: call function result missing 'value' while calling sendkeys method

I'm using latest chrome version i.e. 71 and chromedriver 2.45 . It doesn't seems a compatibility issue.

Observation : chromedriver version 2.45 used to set property but it shows chromedriver=2.33.506120 in exception


Solution

  • This seems default Appium's chromedriver.exe issue in my case as it was taking chromedriver=2.33.506120 by default even i have set 2.45 version. following workaround resolved my issue.

    Prerequisites Should have compatible chromedriver.exe version with the chrome version installed in device/emulator

    setting chromedriver.exe path in Appium using System.setProperty("webdriver.chrome.driver", "D:\\Eclipse\\chromedriver.exe"); won't work

    Use following ways to set chromedriver path in Appium:

    1. Using DesiredCapabilities e.g.

      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setCapability("platformName", "Android");
      capabilities.setCapability("deviceName", "emulator-5554 (9)");
      capabilities.setCapability("platformVersion", "9");
      capabilities.setCapability("browserName", "Chrome");
      capabilities.setCapability("noReset", true);
      capabilities.setCapability("chromedriverExecutable", "D:\\chromedriver_win32_2.45\\chromedriver.exe");
      
    2. Provide chromedriver.exe path while start Appium Server. Refer below snap

      enter image description here