AbstractTestNGCucumberTests中的空指针异常

问题描述 投票:0回答:1

测试NG出错

错误日志:

    [Error] java.lang.NullPointerException
        at cucumber.api.testng.AbstractTestNGCucumberTests.features(AbstractTestNGCucumberTests.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:55)
    at org.testng.internal.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:45

我的测试跑步者设置:

@CucumberOptions(plugin = { "pretty", "html:target/cucumber", "json:target_json/cucumber.json",
        "junit:taget_junit/cucumber.xml", "com.cucumber.listener.ExtentCucumberFormatter"
        }
features = "C:\\AutomationNeon1\\atom\\src\\main\\features\\smascheduler\\new-schedule.feature", glue = {
                "com.morrisons.automation.stepdefs.sma" })
selenium-webdriver cucumber testng ui-automation
1个回答
0
投票

问题是重复步骤定义方法,当我删除重复方法时它得到修复。我已经忽略了Junit日志,它也被打印出来了。

© www.soinside.com 2019 - 2024. All rights reserved.