您的位置:首页 > 其它

unknown error: cannot get automation extension

2016-11-08 15:11 357 查看
今天把Selenium的C# Driver升级到了最新的3.0版,结果Code就一直不能执行了,具体错误信息如下。

System.InvalidOperationException was unhandled by user code

HResult=-2146233079

Message=unknown error: cannot get automation extension

from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"2420.1","isDefault":true},"id":1,"name":"","origin":"chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb"}

(Session info: chrome=54.0.2840.71)

(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64)

Source=WebDriver

StackTrace:

at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)

at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)

at OpenQA.Selenium.Remote.RemoteWebDriver.InternalExecute(String driverCommandToExecute, Dictionary`2 parameters)

at OpenQA.Selenium.Remote.RemoteWindow.get_Size()

at APX.Cloud.WebElement.WebDriver..ctor(String token) in c:\Git\APX.Cloud\APX.Cloud.WebElement\WebDriver.cs:line 77

at APX.Cloud.TestBusinessLogic.Common.APXCloudHelper.InitialWebDriver(String driverToken) in c:\Git\APX.Cloud\APX.Cloud.TestBusinessLogic\Common\APXCloudHelper.cs:line 69

at APX.CloudUI.Test.TestBase.TestInitialize() in c:\Git\APX.Cloud\APX.CloudUI.Test\TestBase.cs:line 160

InnerException:

找了很久才发现原来是我的chromedriver.exe版本太旧了,升级到最新版后就好了。在这里有一个小问题, Selenium的版本规则是大版本号+小版本号,所以:

2.1远远早于2.10

2.9比2.10早

各个版本的时间顺序从新到旧是:

2.19>2.10>2.9>2.1

http://selenium-release.storage.googleapis.com/index.html

Chrome Driver:

http://chromedriver.storage.googleapis.com/index.html

PhantomJS Driver:

http://phantomjs.org/download.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐