Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is QTP able to execute n tests parallel ?
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
You can not run more than 1 test parallelly.
You can run the test sequentially using Batch Runner or define your custom Batch Runner Script.
1) Create a excel with test case name and markes yes or no depending your execution requirement.
2) Use QTP object model to create QTP object.
3) Read from excel take the test case name for which execution status marked as yes.
4) Define your test case path.
4) Use loop to open each test case (using test case path+ Test case name) and execute the test case using QTP Automation object.

Sample Code:
Code:
strTestScriptFolderPath="E:\Alpha Centauri\QA Automation\Test Scripts\"
Set objQTPApp=CreateObject("QuickTest.Application")
objQTPApp.Launch
objQTPApp.Visible =True
Set objInputDataFile=CreateObject("Excel.Application")
'Opening Input data Excel in Read - Write Mode
objInputDataFile.Workbooks.Open inputExcelpath,True,True
Set objCurWorksheet=objInputDataFile.ActiveWorkbook.Worksheets(1)
intRowCnt = objCurWorksheet.UsedRange.Rows.Count
For intCurRow=2 to intRowCnt
    strExeKeyword=objCurWorksheet.Cells(intCurRow,5)
    If LCase(Trim(strExeKeyword))="yes" Then    
        strTestScriptsName=objCurWorksheet.Cells(intCurRow,4)
        x=strTestScriptFolderPath&strTestScriptsName        
        objQTPApp.Open x, False, False
        Set objQTPTest= objQTPApp.Test        
                         objQTPTest.Save        
                         Set objQTPResultsOpt=CreateObject("QuickTest.RunResultsOptions")
        objQTPResultsOpt.ResultsLocation="<TempLocation>"        
        objQTPTest.Run  objQTPResultsOpt
        strResultStatus=objQTPTest.LastRunResults.Status
        If  strResultStatus="Warning" Then
            strResultStatus="Passed"
        End If
        objCurWorksheet.Cells(intCurRow,6)=strResultStatus
        'objQTPTest.Close
    End If
Next

objInputDataFile.Activeworkbook.SaveAs strExectionResultPath
objInputDataFile.Activeworkbook.Close
objInputDataFile.Quit


Regards,
Mrinal Nandi
Automation Tester
Reply


Messages In This Thread
RE: Is QTP able to execute n tests parallel ? - by mrinal_nandi - 04-23-2012, 05:15 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can we execute one script in 10 Languages kotaramamohana 6 5,552 05-21-2012, 10:16 AM
Last Post: kotaramamohana
  "Execute scripts from QC" suresz449 1 4,139 02-23-2012, 02:57 PM
Last Post: inborntester
  Execute file statement aniruddh1984 2 7,419 03-08-2010, 06:44 PM
Last Post: tester_rahul

Forum Jump:


Users browsing this thread: 2 Guest(s)