由于Firefox不再支持GWT DevMode,我想切换到Chrome,为我的应用程序开发selenium测试。
但是,它无法加载GWT-dev-plugin扩展。该测试不会从
返回driver = new ChromeDriver(capabilities);
在没有配置扩展程序的情况下,从某种意义上讲,Chrome实例至少已启动,但没有GWT插件。
这是我配置webDriver
:
在以下代码中将插件.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