Hi,don't enter the host name in QC for which u wish not to execute those tc's Mohan
On Nov 8, 2013 6:21 PM, "Miguel Ángel Díaz Ibáñez" <[email protected]> wrote: > > This is the VBS code. > > '############################################ > ' LAPINEY > ' Script : 17/07/2013 > ' Proyecto MSDD > ' Lanza test y devuelve 0 o 1 en caso de error > '############################################ > ' NOTA: FDBOZZO. 09/10/2013 > ' Para lanzar todos los tests desde QTP, elegir "Run" / "New run results in Quality Center Proyects" y usar este proyecto: > ' Root\N000000_SDD\Functional\02 Ejecuciones Automatización\Integration\Integration > '############################################ > Dim objTDCon, objTreeMgr, objTestSetFolder, objTestSetList > Dim objTestSet, objScheduler, objExecStatus, objTestExecStatus > Dim strTestSetFolderPath, strTestSetName, strReportStatus, intCounter > > 'inicializar > > 'Comentadas by M@D > 'SET WshShell = WScript.CreateObject("Wscript.Shell") > 'Return=WshShell.Run("C:\RemoteAgent.bat",1,true) > > > > 'hora > comienza = Now() > 'MsgBox "INICIO" & vbnewline & comienza & vbnewline & now() > > 'URL del QC server > strQCURL = "http://ses000900-2027/qcbin" > > 'Dominio > strQcDomain = "MAPFRE_FAMILIAR" > > 'Proyecto > strQCProject = "N000000_SDD" > > 'Usuario que ejecuta el test > strQCUser = "xxxxxxxxxxxxx" > > 'Contraseña > strQCPassword = "xxxxxxxxxx" > > 'ruta del test > strTestSetFolderPath = "root\N000000_SDD\Functional\Preproduction\" > > 'Nombre del test > strTestSetName = "PR PES000900-V2228 SDD" > > 'Maquina que ejecuta el test > strHostName = "PES000900-V2228" > > 'Conecta al Quality Center y loguea > Set objTDCon = CreateObject("TDApiOle80.TDConnection") > > 'Realiza la conexion al QC server > objTDCon.InitConnectionEx strQCURL > > 'Login > objTDCon.Login strQCUser, strQCPassword > > 'Domain and project > objTDCon.Connect strQcDomain, strQCProject > > 'Select the test to run > Set objTreeMgr = objTDCon.TestSetTreeManager > Set objTestSetFolder = objTreeMgr.NodeByPath(strTestSetFolderPath) > Set objTestSetList = objTestSetFolder.FindTestSets(strTestSetName) > 'Set objTestSetList = objTestSetFolder.FindTestSets("") > > > intCounter = 1 > > 'busca el test > While intCounter <= objTestSetList.Count > Set objTestSet = objTestSetList.Item(intCounter) > If objTestSet.Name = strTestSetName Then > intCounter = objTestSetList.Count > End If > intCounter = intCounter + 1 > Wend > > > > 'Indico el host y ejecuto el test. > Set objScheduler = objTestSet.StartExecution("") > > ' vacío para local > 'objScheduler.TdHostName = strHostName > objScheduler.Run > > 'Espera > Set objExecStatus = objScheduler.ExecutionStatus > While objExecStatus.Finished = False > objExecStatus.RefreshExecStatusInfo "all", True > If objExecStatus.Finished = False Then > WScript.Sleep 20000 > End If > Wend > > 'Comprobar si falló la ejecución > strReportStatus = "Passed" > For intCounter = 1 To objExecStatus.Count > Set objTestExecStatus = objExecStatus.Item(intCounter) > 'msgbox intCounter & " " & objTestExecStatus.Status > If Not (InStr(1, UCase(objTestExecStatus.Status), UCase("Passed")) > 0) Then > strReportStatus = "Failed" > testsPassed = 0 > Exit For > Else > testsPassed = 1 > End If > Next > objTDCon.DisconnectProject > > If (Err.Number > 0) Then > 'MsgBox "Run Time Error. no se puede finalizar la ejecución!! " & Err.Description & vbnewline & comienza & vbnewline & now() > WScript.Quit 1 > ElseIf testsPassed > 0 Then > 'MsgBox "Tests OK !!" & vbnewline & comienza & vbnewline & now() > WScript.Quit 0 > Else > 'MsgBox "Tests KO!!" & vbnewline & comienza & vbnewline & now() > WScript.Quit 1 > End If > End Sub > > El viernes, 8 de noviembre de 2013 13:10:13 UTC+1, Ganesh muralidharan escribió: >> >> Can't we just put a comment(') in front of those scripts which should not be executed in the vbs? >> >> On Nov 8, 2013, at 5:21 AM, Miguel Ángel Díaz Ibáñez <[email protected]> wrote: >> >>> Hi. >>> >>> I have the next structure: >>> >>> Folder Test\Script1\Script test 1 >>> Folder Test\Script2\Script test 2 >>> Folder Test\Script3\Script test 3 >>> Folder Test\Script4\Script test 4 >>> >>> In the folder Script5 there are 4 scripts >>> Folder Test\Script5\Script test 5 >>> Folder Test\Script5\Script test 6 >>> Folder Test\Script5\Script test 7 >>> Folder Test\Script5\Script test 8 >>> >>> Total of script test 29 >>> >>> I need to execute only 7 script of 29, I have a vbs script that make a loop to execute all the scripts. >>> >>> I don't know how to modify this .VBS to execute only the 7 scripts selecteds. >>> >>> Other important questions is the dependence among some scripts, for example, "the script test 2" must be run before "the script test 3" because this uses a information saved by the prior script. >>> >>> Thanks in avance >>> Miguel Ángel Díaz >>> >>> >>> >>> >>> -- >>> -- >>> You received this message because you are subscribed to the Google >>> "QTP - HP Quick Test Professional - Automated Software Testing" >>> group. >>> To post to this group, send email to [email protected] >>> >>> To unsubscribe from this group, send email to >>> [email protected] >>> >>> For more options, visit this group at >>> http://groups.google.com/group/MercuryQTP?hl=en >>> >>> --- >>> You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group. >>> To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. >>> >>> For more options, visit https://groups.google.com/groups/opt_out. > > -- > -- > You received this message because you are subscribed to the Google > "QTP - HP Quick Test Professional - Automated Software Testing" > group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/MercuryQTP?hl=en > > --- > You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group. > To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google "QTP - HP Quick Test Professional - Automated Software Testing" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/MercuryQTP?hl=en --- You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
