How to connect QTP to Testdirector
Answer Posted / murali raju
I am sending the complete script to connect Quality Center
'***********************************************************
************************************************************
*
'Description:
'
'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.
'
'Assumptions:
'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 qtUpdateRunOptions 'As QuickTest.UpdateRunOptions '
Declare an Update Run Options object variable
Dim qtRunResultsOptions 'As QuickTest.RunResultsOptions '
Declare a Run Results Options object variable
Dim blsSupportsVerCtrl ' Declare a flag for indicating
version control support
Set qtApp = CreateObject("QuickTest.Application") ' Create
the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application
visible
' Make changes in a test on Quality Center with version
control
qtApp.TDConnection.Connect "http://tdserver/tdbin", _
"MY_DOMAIN", "My_Project", "James", "not4you",
False ' Connect to Quality Center
If qtApp.TDConnection.IsConnected Then ' If connection is
successful
blsSupportsVerCtrl =
qtApp.TDConnection.SupportVersionControl ' Check whether
the project supports vervion control
qtApp.Open "[QualityCenter] Subject\tests\test1",
False ' Open the test
If blsSupportsVerCtrl Then ' If the project supports
version control
qtApp.Test.CheckOut ' Check out the test
End If
' Prepare the UpdateRunOptions object
Set qtUpdateRunOptions = CreateObject
("QuickTest.UpdateRunOptions") ' Create the Update Run
Options object
' Set the Update Run options: update the Active Screen
and test object descriptions. Do not update checkpoint
values
qtUpdateRunOptions.UpdateActiveScreen = True
qtUpdateRunOptions.UpdateCheckpoints = False
qtUpdateRunOptions.UpdateTestObjectDescriptions = True
' Prepare the RunResultsOptions object
Set qtRunResultsOptions = CreateObject
("QuickTest.RunResultsOptions") ' Create the Run Results
Options object
qtRunResultsOptions.ResultsLocation
= "<TempLocation>" ' Set a temporary results location
'Update the test
qtApp.Test.UpdateRun qtUpdateRunOptions,
qtRunResultsOptions ' Run the test in Update Run mode
qtApp.Test.Description = qtApp.Test.Description &
vbNewLine & _
"Updated: " & Now ' Document
the update in the test's description (Test Settings >
Properties tab)
qtApp.Test.Save ' Save the test
If blsSupportsVerCtrl And qtApp.Test.VerCtrlStatus
= "CheckedOut" Then ' If the test is checked out
qtApp.Test.CheckIn ' Check it in
End If
qtApp.TDConnection.Disconnect ' Disconnect from Quality
Center
Else
MsgBox "Cannot connect to Quality Center" ' If
connection is not successful, display an error message.
End If
qtApp.Quit ' Exit QuickTest
Set qtUpdateRunOptions = Nothing ' Release the Update Run
Options object
Set qtRunResultsOptions = Nothing ' Release the Run Results
Options object
Set qtApp = Nothing ' Release the Application object
Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
Can I change properties of a test object?
write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object.. (give a filter condition only WEbelement- not easy need to use some more property while giving filter condtions- use google for your help...))
i want information about API testing and i want info like how process can be done in company? i want added info like coding ,debugging, desing in c.v ? what should add in c.v for eg banking domin? pls any answer my question?
What is the quicktest professional testing process?
What is QTP testing process?
Can you write a script to check if the folder exists or not?
can any body give the banking domain concepts/links
What is checkpoints for quicktest professional (qtp)?
whare exactly we have to use functions and sub routain
how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps
Your roles and responsibilities and daily tasks? (As automation tester)
What are the properties you would use for identifying a browser and page when using descriptive programming?
if our qtp vb Script may be Currepted then What we want do?
How does qtp identify objects in the application?
How can we conduct U-I Testing by using QTP??????