Web Service API - Execute specific tests

LegacyForumLegacyForum Posts: 1,669 ✭✭
edited December 2016 in SOAtest
Hi,

I am looking into using the Web Service API to execute tests from Quality Center. I know that you can set the additionalArgs value so that it only executes specific tests within the suite but this is only available when useWebService is false. Is there a way to do this when using the web service?


// Passes additional command line arguments to SOAtest. For example,
// set this to "-testName Method" to only run the test named Method.
// To run the entire test suite, leave this as empty string "".
// Only applicable if useWebService is false.
var additionalArgs = "";

Thanks!

Matt

Comments

  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    Yes, there is a way to do this when using the SOAtest web service interface. Look for a function in the test script called "invokeSOAtestWebServiceAndReport". There is a variable called args which is being set to an XML message. This is the XML message that will be sent to the SOAtest web service. The "soatestOptions" element can have child element called "testName" which works just like the -testName argument from the command line interface.

    So, instead of this:
    "<soatestOptions xmlns=\"http://www.parasoft.com/ns/schema/soatest.xsd\">"; +
    "<qualityCenter>" +
    "<xmlReportLocation>" + xmlReportLocation + "</xmlReportLocation>" +
    "<reportAllTraffic>" + detailedReporting + "</reportAllTraffic>" +
    "</qualityCenter>" +
    "</soatestOptions>"

    You can use something like this intead:
    "<soatestOptions xmlns=\"http://www.parasoft.com/ns/schema/soatest.xsd\">"; +
    "<testName>Name of whatever test in your tst file you want to run</testName>" +
    "<qualityCenter>" +
    "<xmlReportLocation>" + xmlReportLocation + "</xmlReportLocation>" +
    "<reportAllTraffic>" + detailedReporting + "</reportAllTraffic>" +
    "</qualityCenter>" +
    "</soatestOptions>"

    In general, the web service interface mirrors the command line interface. In other words, command line arguments from the command line interface have a corresponding XML element in the web service interface. You can take a look at the WSDL and referenced schemas from http://hostname:9080/axis2/services/SOAtestService?wsdl . In particular, the http://hostname:9080/axis2/services/SOAtes...xsd=soatest.xsd XML schema document describes the soatestOptions element.
  • LegacyForumLegacyForum Posts: 1,669 ✭✭
    edited December 2016

    Thanks!
Sign In or Register to comment.