线程“main"中的异常org.openqa.selenium.WebDriverException:未知错误:调用函数结果缺少“值" [英] Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'

查看:35
本文介绍了线程“main"中的异常org.openqa.selenium.WebDriverException:未知错误:调用函数结果缺少“值"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Android Mobile 的 chrome 浏览器中自动化一个网络应用程序.我有 7.0 版的 ADV

我正在尝试使用以下代码发送用于登录的用户名 -

driver = new AppiumDriver(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")

它抛出以下异常 -

<块引用>

线程main"org.openqa.selenium.WebDriverException 中的异常:未知错误:调用函数结果缺少值"(会话信息:chrome=71.0.3578.99)(驱动程序信息:chromedriver=2.33.506120(e3e53437346286c0bc2d2dc9aa4915ba81d9023f),平台=Windows NT10.0.17134 x86_64)(警告:服务器没有提供任何堆栈跟踪信息)命令持续时间或超时:0 毫秒

注意:请不要将其标记为重复.以下参考资料中的解决方案对我不起作用.

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

解决方案

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

这篇关于线程“main"中的异常org.openqa.selenium.WebDriverException:未知错误:调用函数结果缺少“值"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆