How can we retrieve the Bug Ids which are open&Reopen in
status through QTP scrit?Please find the script which i
tried...

Dim objBugFactory, objBug
Dim BugId

Set TDConnection = QCUtil.TDConnection
Set objBug = TDConnection.BugFactory

If QCUtil.IsConnected then
Reporter.ReportEvent 0, "Connected", "Connected
to server: " + QCUtil.TDConnection.ServerName + chr (13)
+"Project: " + QCUtil.TDConnection.ProjectName + chr (13)
+ "Domain: " + QCUtil.TDConnection.DomainName
Reporter.ReportEvent 0, "Current time on server
is","==>" & TDConnection.ServerTime
Else
Reporter.ReportEvent 1, "Not connected", "Not
connected to Quality Center"
End If

If mybug.Status="Open" Then
BugId=mybug.DefectId
MsgBox BugId
End If

'OR**********************************---------------------
-----**********************************

If Bug_Fields("BG_STATUS").Value ="Open" Or "Re Open"Then
BugId=Bug_Fields("BG_BUG_ID").Value
MsgBox BugId
End If



How can we retrieve the Bug Ids which are open&Reopen in status through QTP scrit?Please find ..

Answer / Avanind Kumar Arya

To retrieve bug IDs with Open and Reopened status using QTP, you can modify your existing script as follows:

```vbnet
Dim objBugFactory, objBug, BugId
Set TDConnection = QCUtil.TDConnection
Set objBug = TDConnection.BugFactory

If QCUtil.IsConnected then
Reporter.ReportEvent 0, "Connected", "Connected to server: " + QCUtil.TDConnection.ServerName + chr (13) + "Project: " + QCUtil.TDConnection.ProjectName + chr (13) + "Domain: " + QCUtil.TDConnection.DomainName
Reporter.ReportEvent 0, "Current time on server is", "==>" + TDConnection.ServerTime
Else
Reporter.ReportEvent 1, "Not connected", "Not connected to Quality Center"
End If

Dim objBugQuery, BugIdCollection, BugId
Set objBugQuery = TDConnection.BugQueryFactory

' Define the query for Open and Reopened bugs
objBugQuery.Define "SELECT BG_ID FROM BUG WHERE BG_STATUS IN ('Open', 'Re-Open')"
Set BugIdCollection = objBugQuery.Execute()

For Each BugId In BugIdCollection
MsgBox BugId.BG_ID
Next
' ... continue with the rest of your script as needed
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

Explain advantages and disadvantages kdf?

1 Answers  


What is diff betwee datatable.importsheet "path" and datatable.import

2 Answers  


WAT IS DATA BASE AND XML CHECK POINT ?HOW TO IMPLEMENT IT ... GIVE PROPER EXAMPLE FOR IT

1 Answers   Infosys,


how to test use the quality control .how to verify the image verification

1 Answers   Wells Fargo,


Explain the new feature of UFT regarding the export of test results?

1 Answers  


Which functionalities of QTP used in banking project?

1 Answers  


can we create recorset with out using database connection in vbscript?

1 Answers   CSS, CSS Corp,


What are the Features & Benefits of Quick Test Pro (QTP 8.0)?

1 Answers  


By using QTP, How do you test a frame in a web page?

4 Answers   TCS,


WHAT ARE THE SHORTCUT KEYS IN QTP?

4 Answers   TCS,


what is use of optionexplicit in variable declaration

5 Answers   GE,


A question was asked in a company-suppose, I am testing a website on QTP, all the time a new title bar is appeared on next page. Trying to use regular expression under key word driven testing but expert view is also appearing unchanged and error is also generating, do you have any best resolution for that kindly explain in detail. please dont give example of yahoomail, that is unable to clear my doubt.

2 Answers  


Categories