Selenium - 当我尝试加载扩展程序时,Chrome无法启动

时间:2014-04-10 09:05:13

标签: google-chrome gwt selenium google-chrome-extension selenium-chromedriver

由于Firefox不再支持GWT DevMode,我想切换到Chrome,为我的应用程序开发selenium测试。

但是,它无法加载GWT-dev-plugin扩展。该测试不会从

返回
driver = new ChromeDriver(capabilities);

在没有配置扩展程序的情况下,从某种意义上讲,Chrome实例至少已启动,但没有GWT插件。

这是我配置webDriver

的方式
  • 打包Chrome安装的GWT插件(此处描述为http://www.mythoughts.co.in/2013/09/seleinum-webdriver-loading-chrome.html#.U0ZTFFfKGno
  • 在以下代码中将插件.crx包的路径用作pluginPath

    ChromeOptions options = new ChromeOptions();
    options.addExtensions(new File(pluginPath));
    DesiredCapabilities capabilities = DesiredCapabilities.chrome();
    capabilities.setCapability(ChromeOptions.CAPABILITY, options);
    File driverExecutable = new File("test-selenium/chromedriver.exe");
    System.setProperty("webdriver.chrome.driver", driverExecutable.getAbsolutePath());
    driver = new ChromeDriver(capabilities);
    

唯一的日志记录是关于插件密钥的警告:

[14.899][WARNING]: Public key in crx header is different from key in manifest
key from header: ....

generated extension id from header key:   godampgacipeiboepncogmjpfbgcpfba 
generated extension id from manifest key: jpjpnpmbddbjkfaccnmhnkdgjideieim

0 个答案:

没有答案