Chrome 打开一秒钟,然后崩溃 [英] Chrome opens for a second and the crashes

查看:41
本文介绍了Chrome 打开一秒钟,然后崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Appium 和 C# 来在我的 Galaxy S5 上运行测试.Everyhting 运行良好,但昨晚我们已将 ChromeDriver 更新到 2.25,突然我手机 中的 chrome 刚刚打开 chrome,在 URL 中显示数据:"并崩溃.另一方面,Windows 操作系统(硒)上的 chrome 运行良好.

I'm using Appium and C# in order to run tests on my Galaxy S5. Everyhting worked perfectly , but last night we have updated the ChromeDriver to 2.25 and suddenly the chrome in my mobile just open the chrome, shows "data:" in the URL and crashes. on the other hand, the chrome in on Windows OS(selenium) works well.

  [SetUp]
        public void Setup() 
       {
           DesiredCapabilities capabilities = new DesiredCapabilities();
           capabilities.SetCapability("device", "Android");
           capabilities.SetCapability("deviceName", "Galaxy S5");
           capabilities.SetCapability("newCommandTimeout", "300");
           capabilities.SetCapability("platformName", "Android");
           capabilities.SetCapability("platformVersion", "6.0.1");
           capabilities.SetCapability("appPackage", "com.android.chrome");
           capabilities.SetCapability("appActivity", "org.chromium.chrome.browser.ChromeTabbedActivity");
         _driver = new AndroidDriver<AppiumWebElement>(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities, TimeSpan.FromSeconds(180));

        
        }

Appium 的错误:

Appium's ERROR:

 info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: A new session could not be created. (Original error: session not created exception\nfrom unknown error: Runtime.executionContextCreated has invalid 'context': {\"auxData\":{\"frameId\":\"31754.1\",\"isDefault\":true},\"id\":1,\"name\":\"\",\"origin\":\"://\"}\n  (Session info: chrome=54.0.2840.85)\n  (Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64)))","status":33,"value":

推荐答案

手动更新 Appium 的 chromedriver 到最新版本为我解决了这个问题.

updating the Appium's chromedriver manually to the latest one fixed the problem for me.

下载最新的chromedriver版本,放到如下路径:

just downlaod the latest chromedriver vsersion and put it in the following path:

C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win

C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win

这篇关于Chrome 打开一秒钟,然后崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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