Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Run Script in multiple versions simultaniously
#1
Not Solved
I have 10 tests in a quality center testset. I need to run these 10 tests in 2 versions of application.
Environment.xls contains the host system name and the application versions.
System1 has application version1
system2 has application version2

So the tests should pick the system name and version number from this sheet and run on that particular host system.

I mean the first test in the testset should read the host system from xls file say system1 which has version1 and execute on that system
Then it has to read the next system name from xls file which contains version2 and execute again on the second system.

Please let me know if it is possible to do this.

Thanks and Regards,
Pallavi
Reply
#2
Not Solved
Are you executing the scripts from Quality Center ?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
Yes Basanth we are executing from quality center.

We need to execute a script from quality center test set which should run in 4 different versions of the application
Reply
#4
Not Solved
Quality Center has a amazing ability to handle multiple host machines and multiple executions.

On the host manager create 2 different sets of hosts. Manually add the required hosts for the application versions.

On your test lab, create test sets to associate the hosts according to the versions. Kick of multiple executions.

All the tests required to be executed against the host machine specific with the version will be executed against it the rest will follow the definition.

IF you dont want to do it the above way and you need to do it dynamically then research on, "TDAPIOLE80.TDCONNECTION" and QCUtil.

Maybe you may need to programatically initate QC execution.

Let me know if it helps !
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#5
Not Solved
Hi basanth,
I need to programatically initiate QC execution.I need to connect to QC. Then execute a testset on a particular remote Host machine.
I tried the below code. But it is not working.


Option Explicit

Code:
Public Sub RunTestSet(otdc, tsFolderName, tSetName, HostName, runWhere)

    Dim TSetFact, tsList
    Dim theTestSet
    Dim tsTreeMgr
    Dim tsFolder
    Dim Scheduler
    Dim nPath
    Dim execStatus
    
    ' 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
    'subject\functionality\SUB FOLDER NAME"
    'nPath = "Root\" & Trim(tsFolderName)
    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
    
    Set tsList = tsFolder.FindTestSets(tSetName)
    
    If tsList Is Nothing Then
        err.Raise vbObjectError + 1, "RunTestSet", "Could not find test set in the " & nPath
    End If
    
    If tsList.Count > 1 Then
        MsgBox "FindTestSets found more than one test set: refine search"
        Exit Sub
    ElseIf tsList.Count < 1 Then
        MsgBox "FindTestSets: test set not found"
        Exit Sub
    End If
    Set theTestSet = tsList.Item(1)
    'Debug.Print theTestSet.ID
    
    'Start the scheduler on the local machine
    Set Scheduler = theTestSet.StartExecution(HostName)
    
    'Set up for the run depending on where the test instances
    ' are to execute.
    
    Select Case runWhere
        Case "RUN_LOCAL"
            'Run all tests on the local machine
            Scheduler.RunAllLocally = True
        Case "RUN_REMOTE"
            'Run tests on a specified remote machine
            Scheduler.TdHostName = HostName
            ' RunAllLocally must not be set for
            ' remote invocation of tests.
            ' Do not do this:
            ' Scheduler.RunAllLocally = False
        Case "RUN_PLANNED_HOST"
            'Run on the hosts as planned in the test set
            Dim TSTestFact, TestList
            Dim tsFilter
            Dim TSTst
            'Get the test instances from the test set
            Set TSTestFact = TestSet.TSTestFactory
            Set tsFilter = TSTestFact.Filter
            tsFilter.Filter("TC_CYCLE_ID") = theTestSet.ID
            Set TestList = TSTestFact.NewList(tsFilter.Text)
            Scheduler.RunAllLocally = False
    End Select
    
    'Run the tests
    Scheduler.run
    
    Set execStatus = Scheduler.ExecutionStatus
    
'    While (RunFinished = False)
'        execStatus.RefreshExecStatusInfo "all", True
'        RunFinished = execStatus.Finished
'    Wend

End Sub

'================================

Const qcHostName = "mendelbrot:8080"
Const qcDomain =  "HOSP"
Const qcProject = "QC_Test"                      'Please define here the name of the project
Const qcUser = "bheemanagoud"                                            'Please define here the username
Const qcPassword = "manasa556$"                                 '‘Please define here the password
Dim tdc
Dim qcServer
Dim objArgs
Dim strArg
Dim strTestSet
Dim bRunCode

'======GETTING ARGUMENTS==============   pxb
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
'===========================================================


    qcServer = "http://" & qcHostName
    qcServer = qcServer & "/qcbin"
    Set tdc = CreateObject("TDAPIOLE80.tdconnection")

If (tdc Is Nothing) Then
    MsgBox "tdc object is empty"
End If

tdc.InitConnectionEx qcServer
tdc.Login qcUser, qcPassword
tdc.Connect qcDomain, qcProject

'RunTestSet tdc,"Insert here path to the test set", strTestSet , "nsert here the name of the machine", "RUN_LOCAL"
RunTestSet tdc,"trial1", "deleted" , "TA-Q5", "RUN_REMOTE"


'Disconnect from the project
If tdc.Connected Then
    tdc.Disconnect
End If
'Log off the server
If tdc.LoggedIn Then
    tdc.Logout
End If
'Release the TDConnection object.
tdc.ReleaseConnection
'Check status (For illustrative purposes.)
Set tdc = Nothing

Please let me know how to do this.

Thanks,
Pallavi
Reply
#6
Not Solved
The Code looks fine. Are you getting a Error Message ??
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#7
Not Solved
No I am not getting any error message. But The 'Scheduler.run
' is not running the scripts
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to send/pass UFT Run Error Dialog as output value to main driver script lravi4u 0 635 11-05-2023, 03:55 PM
Last Post: lravi4u
  How do you Change Run mode mid script? Caleytown 6 7,360 03-25-2021, 08:27 AM
Last Post: RB26578
  How to run driver script to kick off scripts stored in QC? shipu 0 3,613 04-30-2014, 02:39 AM
Last Post: shipu
  Flight API does not run and QTP not recording the script Ruch 0 2,638 08-15-2013, 04:57 AM
Last Post: Ruch
Exclamation Getting run time error while executing the QTP script in command prompt. vishruth143 1 5,728 07-15-2013, 05:41 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)