使用Selenium WebDriver从PortableApps运行Chrome失败

问题描述

我有C#Selenium项目,并希望运行从here下载的便携式Chrome。

我的chromeOptions是:

chromeOptions.BinaryLocation = Path.GetFullPath("C:\","tests.browsers","windows","chrome","GoogleChromePortable.exe"));
chromeOptions.AddArgument("--enable-logging");
chromeOptions.AddArgument("--v=1");
chromeOptions.AddExtension(Path.Combine("path","to","kontur-plugin.crx"));

但是当我运行测试时,Chrome会打开并显示以下内容

screenshot

通知说“无法登录%EXTENSIONNAME%,请单击以再次加载它)

chrome_debug.log没有错误

我在做什么错?如何找出问题所在?

解决方法

这可能会对您有所帮助-Stackoverflow post

此外,您的CRX文件应添加为文件,而不仅仅是路径。