Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Quality Center offers an OTA API to interface with it; however, it is written to use the Microsoft COM structure which Java/Groovy has no native way to consume. Lucky, there is a Groovy library, <a href="http://groovy.codehaus.org/COM+Scripting" rel="nofollow">Scriptom</a>, that allows Groovy to consume COM interfaces.</p> <p>After getting every setup, this is the sample code that I came up with:</p> <pre><code>import org.codehaus.groovy.scriptom.* def tstCaseName = "NAME_OF_TESTCASE" tstCaseName = tstCaseName.replaceAll(/[ ]/) { match -&gt; "*" } Scriptom.inApartment { // Create an entry point for QC def tdc = new ActiveXObject ('TDApiOle80.TDConnection') // Connect to QC, Login with Credentials, connect to Project tdc.InitConnectionEx('http://qc.example.com/qcbin') tdc.Login('USER_NAME', 'PASSWORD') tdc.Connect('DOMAIN_NAME','PROJECT_NAME') // Find the set of tests in the Test Plan tsFolder = tdc.TestSetTreeManager.NodeByPath('Root\\PATH\\TO\\TEST\\CALENDAR\\Spaces are allowed') tsList = tsFolder.FindTestSets('NAME_OF_TEST_CALENDAR') tsObject = tsList.Item(1) // Get the list of TestCases in the Test Plan and filter it down to the one Test Case we are interested in TSTestFact = tsObject.TSTestFactory tstSetFilter = TSTestFact.Filter tstSetFilter.Filter["TS_NAME"] = '*' + tstCaseName TestSetTestsList = TSTestFact.NewList(tstSetFilter.Text) tsInstance = TestSetTestsList.Item(1) // Create a new Test Run newRun= tsInstance.RunFactory.AddItem('Run_Auto') newRun.Status = 'Not Completed' newRun.Post() newRun.CopyDesignSteps() newRun.Post() // Populate Auto Run Test step Data def tsStepData = new Object[3] tsStepData[0]='Auto Data' tsStepData[1]='Not Completed' tsStepData[2]='Results from Automated Test' // Create new Test Step in the run with our Auto Run Data tsSteps = newRun.StepFactory.AddItem(tsStepData) tsSteps.Field['ST_ACTUAL'] = 'These are the actual results from my test!!' tsSteps.post() } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload