尝试从eclipse执行soap ui测试用例时,获取java.lang.Exception:TestCase [测试用例名称]失败,没有断言
SOAPUI->在soapUi中创建一个Testcase并保存项目“ testcase.xml”
eclipse->创建一个新项目,并打开步骤1中保存的项目xml
参考了本教程
https://selenium-qa.com/2018/03/23/soapui-with-bdd-cucumber/
用于运行Soap测试用例的Java代码
SoapUITestCaseRunner SoapUITestCaseRunner= new SoapUITestCaseRunner();
SoapUITestCaseRunner.setProjectFile("resource\\testcase.xml");
SoapUITestCaseRunner.setTestSuite("TestSuite");
SoapUITestCaseRunner.setTestCase("TestCaseName");
SoapUITestCaseRunner.run();
当执行上述代码时,我得到以下错误。
log4j:WARN No appenders could be found for logger (com.eviware.soapui.tools.SoapUITestCaseRunner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.Exception: TestCase [testcasename] failed without assertions
at com.eviware.soapui.tools.SoapUITestCaseRunner.run(SoapUITestCaseRunner.java:392)
at soaptest.executeSOAP.main(executeSOAP.java:37)
最佳答案
检查教程步骤“添加断言”,看来您的测试缺少它们。