Forum Discussion
shiva_kakarla
18 years agoContributor
Hi Ole
I load project from a directory and then create wsdleproject. I get testsuite names from the project and create wsdlsuite object. Using it I get test case names and then try to execute each test case using testrunner. Here is the entire code snippet.
I am not using any IDE to execute my project. I have set groovy classpath to run my groovy script. I have copied all the SOAPUI jars into the groovy classpath folder. I will check if there is clash in loading DOM libraries.
def pathToSettingsFile='C:/soapui-pro-2.0.2/bin/soapui-settings.xml'
SoapUI.setSoapUICore( new SoapUIPro.SoapUIProCore( true, pathToSettingsFile ));
SoapUIProTestCaseRunner proTestcaseRunner= new SoapUIProTestCaseRunner()
proTestcaseRunner.setProjectFile("C:/testsuite/soapuiE2Eprojects/"+soapTestProj)
proTestcaseRunner.setHost('host:8080')
proTestcaseRunner.setJUnitReport(true)
proTestcaseRunner.setPrintReport(true)
proTestcaseRunner.setExportAll(true)
proTestcaseRunner.setOutputFolder("C:/testsuite/build/soupui_reports/"+soapTestProj)
println" File :"+ soapTestProj;
WsdlProject project = new WsdlProject("C:/testsuite/soapuiE2Eprojects/"+soapTestProj);
println("wsdlprojct created")
//Get testsuite names
Map testSuiteMap = project.getTestSuites();
Iterator x = testSuiteMap.keySet().iterator();
while( x.hasNext())
{
String testsuiteName = (String) x.next()
println("testsuite is::"+testsuiteName)
//Create Testsuite
WsdlTestSuite wsdlTestSuite= project.getTestSuiteByName(testsuiteName);
//Get All testcases in the Testsuite
Map testCaseMap=wsdlTestSuite.getTestCases();
Iterator tcase = testCaseMap.keySet().iterator();
//Iterate through testcases and execute one by one.
while(tcase.hasNext())
{
String testCase=(String) tcase.next() //############## Run only the Testcase ##########
println("Executing:"+testCase);
proTestcaseRunner.setTestCase(testCase);
boolean result=proTestcaseRunner.runRunner()
}
}
I load project from a directory and then create wsdleproject. I get testsuite names from the project and create wsdlsuite object. Using it I get test case names and then try to execute each test case using testrunner. Here is the entire code snippet.
I am not using any IDE to execute my project. I have set groovy classpath to run my groovy script. I have copied all the SOAPUI jars into the groovy classpath folder. I will check if there is clash in loading DOM libraries.
def pathToSettingsFile='C:/soapui-pro-2.0.2/bin/soapui-settings.xml'
SoapUI.setSoapUICore( new SoapUIPro.SoapUIProCore( true, pathToSettingsFile ));
SoapUIProTestCaseRunner proTestcaseRunner= new SoapUIProTestCaseRunner()
proTestcaseRunner.setProjectFile("C:/testsuite/soapuiE2Eprojects/"+soapTestProj)
proTestcaseRunner.setHost('host:8080')
proTestcaseRunner.setJUnitReport(true)
proTestcaseRunner.setPrintReport(true)
proTestcaseRunner.setExportAll(true)
proTestcaseRunner.setOutputFolder("C:/testsuite/build/soupui_reports/"+soapTestProj)
println" File :"+ soapTestProj;
WsdlProject project = new WsdlProject("C:/testsuite/soapuiE2Eprojects/"+soapTestProj);
println("wsdlprojct created")
//Get testsuite names
Map testSuiteMap = project.getTestSuites();
Iterator x = testSuiteMap.keySet().iterator();
while( x.hasNext())
{
String testsuiteName = (String) x.next()
println("testsuite is::"+testsuiteName)
//Create Testsuite
WsdlTestSuite wsdlTestSuite= project.getTestSuiteByName(testsuiteName);
//Get All testcases in the Testsuite
Map testCaseMap=wsdlTestSuite.getTestCases();
Iterator tcase = testCaseMap.keySet().iterator();
//Iterate through testcases and execute one by one.
while(tcase.hasNext())
{
String testCase=(String) tcase.next() //############## Run only the Testcase ##########
println("Executing:"+testCase);
proTestcaseRunner.setTestCase(testCase);
boolean result=proTestcaseRunner.runRunner()
}
}