I'm in the very early stages of writing some code that will go and interrogate the test results that are stored in QC, so I'm trying to figure out the logic on how to do this.
From what I can see, the xml results file is saved in the repository on the QC server. This is the file I want to interrogate. This isn't saved in any logical structure, e.g. the last run was saved under "C:\program files\xyz...\1873\3968_45641\Report\" so I presume I have to find out the location of the report from quality center?
If so, how can I obtain path of the report from quality center? Should I:
i) Use SQL to obtain the path directly from the SQL server
ii) Use the QC API to find this out
or are there any other suggestions on how to achieve this?
Thanks for the pointers guys - I'm assuming RunFactory and extendedStorage are parts of the QC API, it's been over a year since I worked with this but I'll look into it.
I've also been digging around in the QC database - it appears that the tables dbo.testcycl and dbo.run also contain a lot of run information which can be used to find out where the result files are saved. It may be quicker than using the API but means I'll have to dust off my SQL book and get writing some queries. If I come up with any useful queries I'll share them here.
This seems to be a good starting point - in this example I'm trying to query all of the test results for a given timeframe.
The TS_PATH and RN_PATH displayed can be used to obtain the path to the results set in the repository on the server.
This approach has the dependency that you have permissions to access the repository to obtain the xml file, which is fine where I work but may not be suitable for larger organisations where more stringent security is in place!
SELECT tTest.TS_NAME, tTest.TS_PATH, tTest.TS_TYPE, tRun.RN_TEST_ID,tRun.RN_PATH , tRun.RN_EXECUTION_DATE, tRun.RN_EXECUTION_TIME
FROM <DBNAME>.dbo.run tRun, <DBNAME>.TEST tTest
Where tRun.RN_TEST_ID = tTest.TS_TEST_ID AND
tTest.TS_TYPE = 'QUICKTEST_TEST' AND
RN_EXECUTION_DATE >= '2010-06-02 00:00:00.000' AND
RN_EXECUTION_DATE <= '2010-06-08 00:00:00.000'
Order by RN_EXECUTION_DATE Asc