获取java.lang.Exception:尝试从Eclipse执行soap ui测试用例时,TestCase [测试用例名称]失败,没有断言
SOAPUI->在soapUi中创建一个测试用例,并保存项目“ testcase.xml”
eclipse->创建了一个新项目,并从第1步打开了保存的项目xml
已参考本教程 https://selenium-qa.com/2018/03/23/soapui-with-bdd-cucumber/
用于运行肥皂测试用例的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)
答案 0 :(得分:0)
检查教程步骤“添加断言”,看来您的测试缺少它们。
答案 1 :(得分:0)
直接从Java运行肥皂项目
ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/C", "Start","C:/Users/Soap.bat");
System.out.println("T2");
File dir = new File("C:\\Users\\ExpediaExamples");
pb.directory(dir);
Process p = pb.start();