我使用Appium和C#在我的Galaxy S5上运行测试。 Everyhting工作得很好,但是昨晚我们已经将ChromeDriver更新为2.25,我的移动中的chrome突然打开了chrome,显示了"数据:"在URL和崩溃。另一方面,Windows操作系统(selenium)上的chrome in效果很好。
[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));
}
&#13;
Appium的错误:
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":
&#13;
答案 0 :(得分:2)
手动将Appium的chromedriver更新到最新版本,为我解决了这个问题。
只需将最新的chromedriver vsersion下载并放入以下路径:
C:\ Program Files(x86)\ Appium \ node_modules \ appium \ node_modules \ appium-chromedriver \ chromedriver \ win