harmans
12 years agoOccasional Contributor
Invoking TestCase from Eclipse
Hi,
I am trying to invoke a TestCase (in SoapUI ) from Eclipse.
Below is Runner class in Eclipse:
public class Runner {
public static void main(String[] args) throws XmlException, IOException, SoapUIException {
WsdlProject project = new WsdlProject("C:\\Code\\src\\SoapUI\\NewConsumer-soapui-project.xml");
TestSuite suite = project.getTestSuiteByName("NewConsumer");
TestCase test = suite.getTestCaseByName("Login");
PropertiesMap map = new PropertiesMap();
map.put("email","q092413@qa.com");
map.put("merchantid","merch123");
TestCaseRunner runner = test.run(map,false);
System.out.println("Context" + runner.getRunContext());
System.out.println(runner.getStatus());
System.out.println("***********************");
}
}
and below is my TestStep request in SoapUI (In Suite 'NewConsumer', TestCase 'Login')
{
"jsonrpc": "2.0",
"id": "1",
"method": "Customer.Authorize",
"params": {
"headers": {
"apiVersion": "1.2",
"realm": [
,
"appVersion": "1.3.9",
"deviceOS": "Android 4.0.4",
"deviceModel": "samsung : SPH-D710"
},
"email":${email},
"MerchantId":${merchantid}
}
}
Log (in eclipse)
14:32:13,849 WARN [SoapUI] Missing folder [C:\Code\src\EclipseSoapDDF\NewConsumer\NewConsumer\.\ext] for external libraries
14:32:14,453 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\Harman\soapui-settings.xml]
14:32:15,802 INFO [WsdlProject] Loaded project from [file:/C:/Code/src/SoapUI/NewConsumer-soapui-project.xml]
14:32:16,934 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
14:32:16,934 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /DataProvider/Login HTTP/1.1
14:32:17,091 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
14:32:17,109 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
Context{}
FINISHED
On executing Runner class from eclipse, TestCase 'Login' never gets invoked. Can someone please help ?
I am trying to invoke a TestCase (in SoapUI ) from Eclipse.
Below is Runner class in Eclipse:
public class Runner {
public static void main(String[] args) throws XmlException, IOException, SoapUIException {
WsdlProject project = new WsdlProject("C:\\Code\\src\\SoapUI\\NewConsumer-soapui-project.xml");
TestSuite suite = project.getTestSuiteByName("NewConsumer");
TestCase test = suite.getTestCaseByName("Login");
PropertiesMap map = new PropertiesMap();
map.put("email","q092413@qa.com");
map.put("merchantid","merch123");
TestCaseRunner runner = test.run(map,false);
System.out.println("Context" + runner.getRunContext());
System.out.println(runner.getStatus());
System.out.println("***********************");
}
}
and below is my TestStep request in SoapUI (In Suite 'NewConsumer', TestCase 'Login')
{
"jsonrpc": "2.0",
"id": "1",
"method": "Customer.Authorize",
"params": {
"headers": {
"apiVersion": "1.2",
"realm": [
,
"appVersion": "1.3.9",
"deviceOS": "Android 4.0.4",
"deviceModel": "samsung : SPH-D710"
},
"email":${email},
"MerchantId":${merchantid}
}
}
Log (in eclipse)
14:32:13,849 WARN [SoapUI] Missing folder [C:\Code\src\EclipseSoapDDF\NewConsumer\NewConsumer\.\ext] for external libraries
14:32:14,453 INFO [DefaultSoapUICore] initialized soapui-settings from [C:\Users\Harman\soapui-settings.xml]
14:32:15,802 INFO [WsdlProject] Loaded project from [file:/C:/Code/src/SoapUI/NewConsumer-soapui-project.xml]
14:32:16,934 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
14:32:16,934 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /DataProvider/Login HTTP/1.1
14:32:17,091 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 200 OK
14:32:17,109 DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
Context{}
FINISHED
On executing Runner class from eclipse, TestCase 'Login' never gets invoked. Can someone please help ?