I'm writing each testcase as each function in that testcase is pass/fail ,I need to update direct result Pass/Fail in to particulat testcase in Test lab for this I tried below
code with particular testcase id it is not updating any results in QC (version 11) plz any one help on this
sStatus = "Pass"
Set QCConnection = QCUtil.QCConnection
Set TestSetFact = QCConnection.TestSetFactory
Set tsTreeMgr =QCConnection.TestSetTreeManager
Set testInstanceF =QCConnection.TSTestFactory
Set aFilter = testInstanceF.Filter
aFilter.Filter("TC_TEST_ID") ="10473" 'testcase ID
Set lst = testInstanceF.NewList(aFilter.Text)
Set tstInstance = lst.Item(1)
tstInstance.Status = sStatus
Set QCConnection = Nothing
Set tsTreeMgr= Nothing
Set testInstanceF= Nothing
In what way is it not working? Is it not setting the status of the test instance, regardless of the value you give it? What value is the test instance status, in the end?
Do you have more than one test instance for the specified test case? Are you sure you are operating on the test instance you think you are? You don't have to use the QCConnection object and the TSTestFactory. You can access the current test instance associated with the run of the script using QCUtil.CurrentTestSetTest.
At the end of the script run I believe QC will automatically review all the Run Steps recorded, and if any are set to Fail it will set the test instance status to Fail. Any Checkpoints or Reporter.ReporterEvent statements that you have in your script that include a pass or fail status will affect the final setting of the test instance status.
(Opinions and information contained in this post are wholly my own and do not reflect the opinions of my employer.)
Thanks for your reply trudy,
I agree your point, but this scripts I'm not running from QC ,if I'm running from QC at the end QC will look all the events and updates the status .my intention is to I have 10 functions(means 10 test cases) I will write those in one script file ,I will excute that script file based on each function result it will update in QC result for the Test case ID .
in QC having each test case having individually combined writing in one script file based on test case passed it need to be update individual test case separately.
it's doing First test case but I need particular test case how to give TestID/Testcase Name in the above code like
qcutil.QCConnection.TestSetTreeManager.NodeByPath( "Root\Blah").TestSetFactory.NewList("").Item(1).Ts TestFactory.NewList("").TestId(130).Field("TC_STAT US") = "Passed"
qcutil.QCConnection.TestSetTreeManager.NodeByPath( "Root\Blah").TestSetFactory.NewList("").Item(1).Ts TestFactory.NewList("").TestCase("First_Testcase") .Field("TC_STATUS") = "Passed"