zoukankan      html  css  js  c++  java
  • Junit +cucumber 运行报错 initiallizationError

    step1: 访问 https://search.maven.org/  搜索下载相关jar包

    step2: 访问 http://maven.outofmemory.cn/info.cukes/cucumber-html/0.2.3/  下载  cucumber-html-0.2.3.jar

    step3: 导入以上JAR 包 。并配置 Junit环境(Add  library -> Junit4)

    Run as -Junit Test 时,会运行失败,如下报错 :

    解决方法1:junit 4.0以上版本需要添加hamcrest.jar 。比如 。。导入hamcrest-core-1.3.jar 

     >>验证无用。另外,发现在导入selenium的jar包的时候,里面其实已经包括了  hamcrest-core-1.3.jar   。不需要重新导入

    解决方法2:

    @Test
    public void abc(){}
    如果括号内有参数,有一定可能会报这种错误

    >>无用 。运行的是简单的测试代码。。都没有参数

    解决方案3:

    升级junit

    解决方案4:

     junit-dep-4.8.1 换成 4.10版本

  • 相关阅读:
    CKeditor3.6.2 配置与精简
    CKEditor与CKFinder整合并实现文件上传功能
    实体关联关系映射:
    status pending状态
    wx:for
    小程序
    获取指定控件的值
    报表
    dataGridView 设置
    SQLite 的使用
  • 原文地址:https://www.cnblogs.com/ericazy/p/6973185.html
Copyright © 2011-2022 走看看