java - Minium 使用胶水和浏览器抛出错误

标签 java spring selenium-webdriver cucumber

有谁知道为什么 Minium(Selenium Webdriver Java + Cucumber)抛出这个错误跟踪?

我已经找了几个小时了,但似乎没有什么可以解决这个错误。

项目结构

enter image description here

Java:

import minium.cucumber.MiniumCucumber;

import java.io.IOException;

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.cli.Main;
import ModulosComunesWeb.*;

@RunWith(MiniumCucumber.class)
/*@CucumberOptions(
        features = "LO-PPE-WEB-AltaFavoritos.feature"
    //  ,glue={"stepDefinition"}
        )
@CucumberOptions(

        features= "LO-PPE-WEB-AltaFavoritos.feature"
)*/
public class LOFavoritasIT {


}

2018-07-10 12:35:08.977 WARN 17180 --- [engine-thread-0] minium.cucumber.internal.MiniumBackend : Could not load glue src/test/resources/steps

org.mozilla.javascript.WrappedException: Wrapped org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'browser' defined in minium.web.config.WebElementsConfiguration: Unsatisfied dependency expressed through method 'browser' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'wd' defined in minium.web.config.WebElementsConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.openqa.selenium.WebDriver]: Factory method 'wd' threw exception; nested exception is java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.chrome.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. The latest version can be downloaded from http://chromedriver.storage.googleapis.com/index.html (minium/minium.js#23) at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1893) at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:148)

最佳答案

您需要检查您的 Google Chrome 浏览器版本才能下载 chromedriver匹配浏览器版本。如果您使用的不是最新版本,请下载与您的浏览器版本匹配的 chromedriver 并将“.exe”文件复制到 Minium Developer 的 drivers 文件夹中。

如果你有最新的谷歌Chrome浏览器版本,Minium Developer可以为你下载最新的webdrivers:https://minium.vilt.io/docs/developer/minium-developer/#update-webdrivers

关于java - Minium 使用胶水和浏览器抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51263236/

相关文章:

java - 如何用 ASM 重命名一个类并保持在同一个类加载器中?

java - 在名称为 ___ 的 DispatcherServlet 中未找到 URL ___ 的 HTTP 请求的映射

java - hibernate 没有在 spring mvc 中更新

java - Spring4 JUnit 测试 : Load SQL to a H2 db

java - 如何在 Selenium 中使用 CSS 选择器找到 TinyMCE 编辑器的主体?

将实现的类分配给接口(interface)时出现Java Reflection NoSuchMethod异常

java - 使用Spring中的Aspects计算方法处理时间

java - jackson 反序列化具有相同名称的xml字段

java - 等待 get 请求在 Selenium 中完成

java - 通过 PID 进程杀死 Selenium 浏览器 [Java]