QC: Update Test Plan when Test Fails in Test Lab

Question ID: 104138
4
0

I need to update 2 fields in the Test Plan when the test fails in the Test Lab. I was using the following code to send mail when the test fails (this part works fine) and thought I could use the 2 final statements to update the TS_STATUS and TS_USER_02 Fields in the Test Plan, but it does not work. Does anyone have an idea about how I can accomplish this? Thanks in advance for any help.

‘Send mail if test fails and set test plan statuses
if TestSetTest_Fields.Field("TC_STATUS").Value="Failed" then
testID = TestSetTest_Fields.Field("TC_TEST_ID").Value
strTestName = TDConnection.TestFactory.Item(testID).Field("TS_NAME")
strSubject = "Test Case Failure Notification"
strBody = "The test " & strTestName & " failed." & " It is in the project " & TDConnection.ProjectName & _
" which is in the domain " & TDConnection.DomainName & "."
strTo = TestSetTest_Fields.Field("TS_RESPONSIBLE").Value & ";[QA Lead];[Automation Lead]"
Email strTo, strSubject, strBody
end if
TDConnection.TestFactory.Item(testID).Field("TS_STATUS").Value = "Research"
TDConnection.TestFactory.Item(testID).Field("TS_USER_02").Value = "Research"

Marked as spam
Posted by (Questions: 16, Answers: 748)
Asked on June 28, 2010 9:18 pm
6 views
Answers (3)
3
Private answer
Marked as spam
Posted by (Questions: 0, Answers: 613)
Answered on July 3, 2010 1:56 am
I tried the suggested code and it seems to work up to the line: TDConnection.TestFactory.Item(CInt(MyTestId)).Field(''TS_STATUS'')=''YOURLISTVALUE'' I put in msgbox statements to track the code and it was getting the correct status and test id, but it is still not updating the TS_STATUS field.
( at July 6, 2010 3:55 pm)
Turns out that this code does work. We had other workflow involved that was somehow blocking this from working. When we re-worked that code, this code started working fine.
( at July 12, 2010 8:37 pm)
Document now includes support for QCv10 Version Controlled Projects.
( at July 13, 2010 6:45 pm)
0
Private answer

How can we change the linkage between test set in the Test plan and test lab...When I right-click a test case in test lab and go to test set in test plan, I am going to some set in the test plan..I want to change the linkage...

Marked as spam
Posted by (Questions: 0, Answers: 2)
Answered on March 4, 2011 5:48 am
I think this should be asked as a different question instead of a reply to this one.
( at March 4, 2011 12:58 pm)
0
Private answer

In second part of your code I don't see where you are referencing the TC_TEST_ID from test lab to the test case id in plan...you have to get the test case id from test lab and compare it to the test case id in test plan, if they both match then you should be able to update the values. I hope this helps.

Marked as spam
Posted by (Questions: 0, Answers: 4)
Answered on July 2, 2010 8:01 pm