Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Web Service API - Execute specific tests

LegacyForum
LegacyForum Posts: 1,664 ✭✭
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

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    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\">&quot; +
    "<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\">&quot; +
    "<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.
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    edited December 2016

    Thanks!