“收到未知命令"; MicrosoftWebDriver和Selenium(C#)时出错 [英] "Unknown command received" errors using MicrosoftWebDriver and Selenium (C#)
问题描述
我正在使用Selenium(v2.47)和Microsoft Web驱动程序(v10.0.10240.0).我正在使用一些已经可以在Firefox,IE和Chrome上正常运行的C#代码,并且我想使用它在Windows 10上测试新的Edge浏览器.我的代码能够成功打开浏览器并导航到我的登录页面.但是,当我执行一些基本操作时,会出现收到未知命令"异常:
I am using Selenium (v2.47) and the Microsoft Web Driver (v10.0.10240.0). I am working with some existing C# code that already runs fine on Firefox, IE and Chrome and I want to use it to test the new Edge browser on Windows 10. My code is able to successfully open the browser and navigate to my login page. However I get an "Unknown command received" exception when I do a few basic things such as:
1)最大化浏览器
2)在现有IWebElement上调用.FindElement(by).
2) call .FindElement(by) on an existing IWebElement.
例如:
driver.Manage().Window.Maximize(); //引发异常
driver.Manage().Window.Maximize(); //throws exception
...
IWebElement parent = driver.FindElement(By.TagName("body")); //有效
IWebElement parent = driver.FindElement(By.TagName("body")); //works
...
parent.FindElement(by); //引发异常
parent.FindElement(by); //throws exception
有没有人看到Edge浏览器将Selenium和C#与这两种方法一起使用?也许我在这里做错了.还是收到未知命令"只是意味着将来会出现未实现的功能?
Has anyone seen either of these work with Selenium and C# for the Edge browser? Maybe I am doing something wrong here. Or does "Unknown command received" just mean it is unimplemented functionality that will come in the future?
推荐答案
在最初的Edge驱动程序(10.0.10240)版本中有相当多的功能缺失,包括缺少对IWebElement.FindElement()
的支持.后续发行版也需要通过Windows 10更新对Edge本身进行更新,直到最近才可以通过所谓的Insider构建来获得. Microsoft在其
There was a fair amount of missing functionality in the initial (10.0.10240) Edge driver release, including missing support for IWebElement.FindElement()
. Subsequent releases, which also required an update to Edge itself via Windows 10 updates, and until very recently only available via so-called Insider builds. A full accounting of what was implemented and when is provided by Microsoft at their WebDriver implementation status page.
这篇关于“收到未知命令"; MicrosoftWebDriver和Selenium(C#)时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!