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
what is run-time data?
How do you do batch testing in wr & is it possible to do in qtp, if so explain?
Presently i am working on QTP 8.2 Version,i want to know features in 9.2 version, because i have not sufficient time to put the effort on the 9.2 version
What are the different types of recording modes?
Hi, While recording a Jave based web application, its recording all my actions and the objects.And I have 5 WebEdit objects on the page and all are recorded. But while execution, at the 2 WebEdit object, its entering the value into the object (Its making a call to the AJAX, matching the value), when the control get out of this object the value is erased or cleared. Could anyone please help. I have recoreded 5 more scenarios where WebEdit is in the picture on different webpages and all are working fine. Here is my Script: Browser("Sign In").Page("Matching Workbench_3").WebEdit ("locationLookup").Set "0320 - SEATTLE-KM" Browser("Sign In").Page("Matching Workbench_3").WebEdit ("supplierNameLookup").Set "TRAMMO PETROLEUM INC" *** SupplierNameLookup is the object, which is haing an issue. And also I was using the SendString function, but it didnt work.
How to use output values in qtp ?
Can you brief the hurdles you faced during Automation testing?
What is the extension of the qtp local repository? If it is .mtr then what is .bdb extension stands for?
Can we write winrunner language i.e TSL in QTP tool?
In Remote acess server how u run a test?
How do you script a nested loop in QTP? I am showing a snipet of my code. Any suggestions to help me get this to work would be great appreciated! STEP A - Customer Number: No loop - ISBN: Loop STEP B - Customer Number: Loop - ISBN: Nested Loop Here is the code I am using now. I am using i for the loop and j for the nested loop in STEP B of my script. =========================================== 'CREATE AN ADDITIONAL CUSTOMER Dim myNum, RowNum, RowCnt2, val2, total, i DataTable.ImportSheet "C:\QOE Data - UAT1.xls" ,"Data" ,"Global" RowCnt2 = DataTable.GetRowCount i = 1 DataTable.SetCurrentRow(i) ' Set row to one Do while Not i > RowCnt2 i=i+1 DataTable.SetNextRow MsgBox Datatable.Value("Customer_Num") Msgbox i Msgbox RowCnt2 If Not i > RowCnt2 then val2=datatable.Value("Customer_Num","Global") OracleFormWindow("Sales Order").SelectMenu "File->New" OracleFormWindow("Sales Order").OracleTabbedRegion("Order Information").OracleTextField("Customer Number").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Order Information").OracleTextField("Customer Number").Enter val2 End If 'CREATE SECOND ISBN LIST DataTable.ImportSheet "C:\QOE Data - UAT1.xls" ,"Data" ,"Global" Dim j, RowCnt3, val3 RowCnt3 = DataTable.GetRowCount For j = 1 To RowCnt3 DataTable.SetCurrentRow(i) ' datatable.getSheet("DataTable").setNextRow If Trim(DataTable("ISBN",dtGlobalSheet)) = "" Then j = j - 1 Exit For End If Next 'Define ISBN rows If RowCnt3 <> j Then RowCnt3 = j End If 'Loop through ISBN rows For j = 1 To RowCnt3 DataTable.SetCurrentRow(i) val3 = Datatable.Value("ISBN","Global") msgbox j If j = 1 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item").Enter val3 else If j < 16 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_"&i).SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_"&i).Enter val3 else If RowCnt1 => 16 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").InvokeSoftkey "DOWN" OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").Enter val3 end if end if End If Next 'EXIT APP msgbox i loop Browser("Browser").Page("Oracle Applications 11i").Sync Browser("Browser").Close ========================================== It isn't working correctly in my nested loop in STEP B (for ISBN). Any ideas?? Thanks! SBsteve
What is quicktest professional (qtp)?
Suppose I have three hyperlinks with same properties. How to solve this and what are the ways to solve this. we can solve this by using index property but what are the other ways we have have to solve this problem. Login (href: btnlogin.aspx) Login (href: Sourcelogin.aspx) Login (href: homelogin.aspx)
HI Everybody, I am using QTP 9.2, I have a problem and hope everybody help me solve it. Now I need to use mouse wheel event to zoom in or zoom out in web client, but QTP can't catch this event. I look forward helping of everybody. Thank you very much.
iam working in QTP for 2+ of exp if i attend the interview what r questions asked in perfomence testing{loadrunner} ? pls any one can say answer to this question?