웹 서비스를 실행하기 위해 SoapUI를 사용하고 있습니다. 이제 자동화 회귀 테스트 프로젝트 (Java, Maven, Selenium Webdirver)를 만들고 있습니다. 테스트 시작 또는 중간에 웹 서비스 요청을 보내기 위해 SoapUI가 필요한 많은 테스트 스위트가 있습니다. SoapUI 소스 코드를 가져 오거나 내 프로젝트에 SoapUI jars를 설치할 수있는 방법이 있는지 궁금합니다. 그래서 SoapUI 함수 나 메서드 또는 클래스를 직접 호출 할 수 있습니다. 내 pom.xml에 이러한 종속성을 추가했습니다.
<dependency>
<groupId>com.github.redfish4ktc.soapui</groupId>
<artifactId>maven-soapui-extension-plugin</artifactId>
<version>4.6.4.0</version>
</dependency>
<dependency>
<groupId>net.java.dev.jgoodies</groupId>
<artifactId>looks</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>net.sf.squirrel-sql.thirdparty-non-maven</groupId>
<artifactId>com-fifesoft-rsyntaxtextarea</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.karaf.eik.plugins</groupId>
<artifactId>org.apache.commons.collections</artifactId>
<version>3.2.1</version>
</dependency>
SoapUI Intellij Idea Plugin도 설치했습니다. 그러나 아무것도 변하지 않은 것 같습니다. 도움과 조언에 감사드립니다. 또는이 기능을 구현하는 다른 방법이있는 경우에도 좋습니다.
C : \ Program Files (x86) \ SmartBear \ SoapUI-5.2.1 \ lib 및 C : \ Program Files \ SmartBear \ SoapUI-5.2.1 \ bin에서 모든 soapUi jar 및 SoapUI.jar를 가져 오십시오.
public void runTestCase(String tarSuite, String tarCase) throws Exception {
String reportStr = "";
SoapUI.setSoapUICore(new StandaloneSoapUICore(true));
WsdlProject project = new WsdlProject("C:\\Users\\tshi\\Documents\\Maven Projects\\ASORT\\WebServiceResource\\Suncorp_Issuing-soapui-project.xml");
List<TestSuite> suiteList = project.getTestSuiteList();
for (TestSuite aSuiteList : suiteList) {
String suiteName = aSuiteList.getName();
List<TestCase> caseList = aSuiteList.getTestCaseList();
//System.out.println("Test Suite: " + suiteName);
if (suiteName.equals(tarSuite)) {
for (TestCase aCaseList : caseList) {
String caseName = aCaseList.getName();
//System.out.println("Test Case: " + caseName);
if (caseName.equals(tarCase)) {
long startTime = System.currentTimeMillis();
TestRunner runner = project.getTestSuiteByName(suiteName).getTestCaseByName(caseName).run(new PropertiesMap(), false);
long duration = System.currentTimeMillis() - startTime;
reportStr = reportStr + "\n\tTestCase: " + aCaseList.getName() + "\tStatus: " + runner.getStatus() + "\tReason: " + runner.getReason() + "\tDuration: " + duration;
}
}
}
}
System.out.print(reportStr);
}
이것은 목표를 달성하는 가장 좋은 방법이 아닐 수 있습니다. 하지만 실제로는 저에게 효과적입니다. 모든 장치를 환영합니다. 모두 감사합니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다