Академический Документы
Профессиональный Документы
Культура Документы
1.To integrate QC and QTP both need to be installed in the same machine .
2.Download QTP add in from QC add ins section
3.YOu will find the QC symbol in the QTP
4.Double click on the QC Symbol
5.Enter the link of QC
6.Domain name and Project name
7.IF you want to connect o qc automatically when QTP is opened you have an option
you can select that .
Dim QCConnection
Set QCConnection = CreateObject("TDApiOle80.TDConnection")
QCConnection.InitConnectionEx "http://yourserver/qcbin"
QCConnection.login "login", "password"
QCConnection.Connect "Domain", "Project"
###################################################
####################
'Function :AttachToQC
'Date : 17/09/2007
'Author : Gokul Putta
'Purpose :This function is used to attach the file to QC from file system
'Remarks :
'Inputs :strQCPath --> path of the folder in the QC to attach the file (should start
from Subject\)
'strFileSystemPath --> path of the file to be attached to QC in the filesystem
'Change History :
'Date Author Change Description
'###################################################
###################
Description
An object that enables you to manage the Quality Center connection and retrieve the
TDOTA object, which provides full interaction with Quality Center.
Example
Connect to Quality Center
Methods
Connect
Connects QuickTest to the Quality Center project.
Disconnect
Disconnects QuickTest from the Quality Center project.
Properties
Domain The Quality Center domain to which QuickTest is currently
connected.
IsConnected Indicates whether QuickTest is currently connected to
Quality Center.
Project The Quality Center project to which QuickTest is currently
connected.
Server The Quality Center server to which QuickTest is currently
connected.
SupportVersionCont Indicates whether the Quality Center server to which
rol QuickTest is connected supports version control.
TDOTA Returns a TDOTA object, which exposes the Quality Center
API and provides full interaction with Quality Center.
User
The user that is currently connected to Quality Center.
'
'This example connects to a Quality Center project, opens a test (checks it out,
if applicable),
'updates the Active Screen values and test object descriptions, and, if
applicable,
'checks the modified test back into the Quality Center project.
'
'Assumption
s:
'The test1 test is not already checked out.
'There is no unsaved test currently open in
QuickTest.
'For more information, see the example for the Test.SaveAs
method.
'When QuickTest opens, it loads the add-ins required for
the test.
'For more information, see the example for the Test.GetAssociatedAddins method.
'*************************************************************************************
***********************************
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim qtTest 'As QuickTest.Test ' Declare a Test object variable
Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object
Recently I’ve encountered a task: to create a script that would connect to QC and run
a test set. It was expected that the execution of this script will be initiated by
Outlook. The main idea was - a notification comes to my inbox and Outlook runs the
script that runs a test set.
I knew that QC (and QTP also) has its Open Test Architecture API. I’ve downloaded a
manual from the QC and explored a connection method, took a peace of code that
runs a test set and modified it.
‘===================================== ‘
‘ VBScript Source File — Created with SAPIEN Technologies PrimalScript 4.1
‘
‘ NAME:
‘
‘ AUTHOR: Vadim Nekhai
‘ DATE : 17.12.2007
‘
‘ COMMENT:
‘
‘====================================
‘Option Explicit
‘ Get the test set tree manager from the test set factory
‘tdc is the global TDConnection object.
Set TSetFact = otdc.TestSetFactory
Set tsTreeMgr = otdc.TestSetTreeManager
‘ Get the test set folder passed as an argument to the example code
nPath = “Root\” & Trim(tsFolderName)
Set tsFolder = tsTreeMgr.NodeByPath(nPath)
If tsFolder Is Nothing Then
err.Raise vbObjectError + 1, “RunTestSet”, “Could not find folder ” & nPath
End If
‘ Search for the test set passed as an argument to the example code
‘================================
Const qcHostName = “”
Const qcDomain = “”
Const qcProject = “” ‘Please define here the name of the project
Const qcUser = “” ‘Please define here the username
Const qcPassword = “” ‘Please define here the password
Dim tdc
Dim qcServer
Dim objArgs
Dim strArg
Dim strTestSet
Dim bRunCode
‘======GETTING ARGUMENTS==============
set objArgs = WScript.Arguments
If WScript.Arguments.Count<1 Or WScript.Arguments.Count>2 Then
WScript.Echo “Please enter the name of the test set”
bRunCode = False
Else
For Each strArg in objArgs
WScript.Echo strArg&” is starting…”
strTestSet = strArg
bRunCode = True
Next
End If
‘===================================================
========
If bRunCode Then
qcServer = “http://” & qcHostName
qcServer = qcServer & “/qcbin”
Set tdc = CreateObject(”tdapiole80.tdconnection”)
tdc.InitConnectionEx qcServer
tdc.Login qcUser, qcPassword
tdc.Connect qcDomain, qcProject
RunTestSet tdc, “Insert here path to the test set”, strTestSet , “Insert here the name
of the machine”, “RUN_LOCAL”