Micro Focus QTP (UFT) Forums
How can I report defects to QC from script results - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: How can I report defects to QC from script results (/Thread-How-can-I-report-defects-to-QC-from-script-results)



How can I report defects to QC from script results - BullzEyezz - 03-22-2010

Is there a way to create defects on QC from test results? In case if a certain test fails a defect is opened reporting it on QC.


RE: How can I report defects to QC from script results - Ankur - 03-23-2010

You need to connect QTP with QC. This guide may be of some help.


RE: How can I report defects to QC from script results - BullzEyezz - 03-23-2010

Thanks Ankur for your quick reply. However, I already have QTP connected with QC and have my scripts uploaded to QC. What I want to know is how to open defects if after running a script and some errors were found?


RE: How can I report defects to QC from script results - jsknight1969 - 03-25-2010

In QTP under Tools/Options there is a setting to "Submit Defect to QC for each failed step". Set that. That will automatically create defects if steps fail. If you need to manually report a failure use:

Code:
Reporter.ReportEvent micFail, "Step", "Reason

With the defect option set, that will create defects when you manually create a failed point. you can also use:

Code:
Services.SetTransactionStatus Fail

This will fail a step as well and create a defect if the option is selected.

I hope this is what you were interested in.


RE: How can I report defects to QC from script results - BullzEyezz - 07-22-2010

I'm able to connect to QC manually and report defects from the Test Results manually, but all what is written in the defect is the path of the test itself. What I need is to be able to customize what's written in the defect (or at least to include what's in Test Result)

Any help?


RE: How can I report defects to QC from script results - BullzEyezz - 07-22-2010

Okay, I got now how to create a defect from QTP using
Code:
Dim QCConnection

Set QCConnection = QCUtil.QCConnection

'Get the IBugFactory

Set BugFactory = QCConnection.BugFactory

'Add a new, empty defect

Set Bug = BugFactory.AddItem (Nothing)

'Enter values for required fields

Bug.Status = "New"

Bug.Summary = "New defect"

Bug.DetectedBy = "admin" ' user that must exist in the database's user list

'Post the bug to the database ( commit )

Bug.Post

But there're some fields I can't alter, such as: Build, Team Lead, QA Responsibility, Status Detail.

Anyone know how to change the values of the mentioned fields? (tried using
Code:
Bug.field("BG_Team_Lead")
but didn't work