У меня есть некоторые пользовательские свойства для всех тестовых примеров в SoapUI.Как удалить свойства custome из тестового примера SOAPUI с помощью java?
Я могу удалить с помощью Groovy шаг сценария, как описано ниже, в вопросе:
How to remove Custom Properties from a SoapUI TestCase using Groovy?
testRunner.testCase.removeProperty("Testcase_Property");
Но я хотел, чтобы удалить эти свойства из JAVA. Ниже приведен код, который я написал:
String soapuiProjectPath = "ProjectLocation";
WsdlProject project = new WsdlProject(soapuiProjectPath);
StringToObjectMap context = new StringToObjectMap();
TestSuite testSuite = project.getTestSuiteByName("TestSuiteName");
WsdlTestSuite wsdlSuite = (WsdlTestSuite) testSuite;
List<TestCase> allTestCaseList = wsdlSuite.getTestCaseList();
for (TestCase testCase : allTestCaseList) {
WsdlTestCaseRunner testCaseRunner = new WsdlTestCaseRunner((WsdlTestCase) testCase, context);
List<TestProperty> testCasePropertyList = testCase.getPropertyList();
for (TestProperty testProperty : testCasePropertyList) {
WsdlTestRunContext runContext = testCaseRunner.getRunContext();
runContext.removeProperty(testProperty.getName());
}
}
System.out.println("Completed execution.");
project.save();
Это не исключение. Но фактически не удалять пользовательские свойства.
Это работает отлично. Спасибо за ответ :) – HemaSundar
@HemaSundar приятно вам помочь ':)' – albciff