Showing posts with label QC. Show all posts
Showing posts with label QC. Show all posts

Friday, January 25, 2013

Retrieving Test Case name from QC

Retrieving Test Case name from QC


Set td=createobject("TDApiOle80.TDConnection")
td.InitConnectionEx "http://Link/qcbin"
td.ConnectProjectEx "DOMAIN", "PROJECT","USERNAME", "PASSWORD"

Set tstMgr = td.TreeManager
Set tsttr = tstMgr.NodeByPath("Path")
Set tsetFact = tsttr.TestFactory
Set tsetList = tsetFact.NewList("")

For Each tset in tsetList
   Msgbox ("Test Name = " & tset.Name)
Next

td.Disconnect
td.logout
set td=nothing

Wednesday, January 23, 2013

Running Test Cases in QC using QTP

Sometimes it might be required to match the data provided say in an excel with Test case name as in QC while running Automated Test Cases using QTP.Then QTP allows user to create QTP object inside QTP and killing of QTP object or deallocation of QTP object will not affect currently opened QTP.

Function tc_check(TCName)
Set oQTP=createobject("quicktest.application")
QC_Loc=oQTP.Test.Location
bStatus=instr(1,lCase(QC_Loc),trim(lcase(TCName) ) )
if bStatus>0 then
msgbox "matching TC found"
else
msgbox "TC does not match"
end if
oQTP=nothing
End Function