Hello;
Our PPM system calls a VBS as it is
cscript qc.vbs 'P' '185243' 'MAYA LOGIN VE OTP GELISTIRMELERI' '191935' 'Test Talebi: MAYA LOGIN VE OTP GELISTIRMELERI - Work Package - Domain 1' 'Work Package - Domain 1' '2987832' 'SPD'
It creates 3 test cases under testlab.
QC's Portfoilo, project, foldername information come from PPM fields.
Now we want to replace VBS with a web service because of working speed.
Question 1) Can web service of ALM work faster than VBS.
Question 2) Can we call a webservice of ALM from PPM? Our developers say that they need a class file. I read authentication part of QC's REST API document, I am not sure if PPM can call a web service from an execution.??
Question 3) Is there any buildin web service to create a folder with name of fast track, create another folder with name of test request, 3 test sets with given names? If so can you make an example?
Question 4) How this webservice works in behind? does it calls VBS in QC or make execution with java or .net?
I am attaching VBS and screen shot of ALM
'**************************************************
'Genel TANIMLAMALAR
'**************************************************
Dim StartTime,EndTime
StartTime = Timer()
Dim Connnn,Cn,p_db_user,p_db_pass,app_db_user,app_db_pass 'for sub getDBConnection
Dim p_url,p_user,p_passw
Dim ProjectName,TestTalepDesc,Origin_Type
Dim Sonuc,strQCConnControl,HATA_MSJ 'HATA_MSJ genel olarak herhangi bir yerdeki hatayi tutar.
Dim p_TestSetName(2),p_TestSetType(2)
Dim bugfix_createdyear, bugfix_createdmonth, index
'------------- ALM Login bilgileri---------------------------
p_user="deleted"
p_passw="deleted"
'---------------------ALM PROD ORTAMI-------------------------
p_url="http://alm/qcbin/"
Connnn="(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = deleted)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST = deleted)(PORT = 1521))(LOAD_BALANCE = yes)(FAILOVER=on)(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = QC)(failover_mode= (type = session)(method=basic)(RETRIES=180)(DELAY=5))))"
p_db_user="deleted"
p_db_pass="deleted"
app_db_user="deleted"
app_db_pass="deleted"
'---------------------------------------------------------
Sonuc="0"
QC_Synchronize WScript.Arguments.Item(0), WScript.Arguments.Item(1), WScript.Arguments.Item(2),WScript.Arguments.Item(3), WScript.Arguments.Item(4), WScript.Arguments.Item(5), WScript.Arguments.Item(6), WScript.Arguments.Item(7)
'---------------------------------------------------------
Function QC_ConnectionControl(Number,Description)
On Error Resume Next
strQCConnControl=0
If Description = "Server is not available" Or Number="-2147418113" Then
strQCConnControl="0"
objTDConnection.Disconnect
Call InsertLogText( "ALM Servisi kapali : Error Code: " & Description & " - " & Number)
Else
strQCConnControl=1
End If
End Function
'---------------------------------------------------------
Function InsertLogText(logDesc)
Dim outfile,objFile,objFSO,today
today=Right(Year(Date),2) &"."& Right("0" & Month(Date),2) &"."& Right("0" & Day(Date),2)&" "& FormatDateTime(Time(),3)&" "&WScript.Arguments.Item(3)&" "
Set objFSO=CreateObject("Scripting.FileSystemObject")
outFile="C:\PPM\qcvbslog.txt"
Set objFile = objFSO.OpenTextFile(outFile,8,True)
objFile.Write today & " " & logDesc & vbCrLf
objFile.Close
End Function
Function GetMonthName()
Dim index, currentmonth(11)
index=(Month(Date))-1
currentmonth(0)="Ocak"
currentmonth(1)="Subat"
currentmonth(2)="Mart"
currentmonth(3)="Nisan"
currentmonth(4)="Mayis"
currentmonth(5)="Haziran"
currentmonth(6)="Temmuz"
currentmonth(7)="Agustos"
currentmonth(8)="Eylul"
currentmonth(9)="Ekim"
currentmonth(10)="Kasim"
currentmonth(11)="Aralik"
bugfix_createdmonth=currentmonth(index)
GetMonthName=currentmonth(index)
End Function
'--------------------------------------------------------
' Test Lab alaninda yaratilacak Klasorlerin tipi ve nereye yaratilacagi bu fonksiyonda belirlenir.
' PPM de Aksiyon alindiginda Folder yaratma için tüm islemin yapildigi fonksiyondur.
Function Get_FolderCreate(strDomain,strQC_Project,strTTechProjectID,TestTaledID,Origin_Type,strProjectName)
Dim PrjName,TestTlpDsc,RootFolder
On Error Resume Next
Set objTDConnection = CreateObject("TDApiOle80.TDConnection") 'QC ile Conn olusturur
objTDConnection.InitConnectionEx p_url
Call QC_ConnectionControl(Err.Number,Err.Description)
if strQCConnControl=1 then
objTDConnection.Login p_user, p_passw
objTDConnection.Connect strDomain,strQC_Project
if Origin_Type="P" or Origin_Type="F" or Origin_Type="B" then
Select Case Origin_Type
Case "P"
RootFolder="Root\Project"
ProjectName=strTTechProjectID & "-" & strProjectName
PrjName=RootFolder &"\"&ProjectName
Case "F"
RootFolder="Root\FastTrack"
ProjectName=strTTechProjectID
PrjName=RootFolder &"\"&ProjectName
Case "B"
bugfix_createdyear=Year(Date)
Call GetMonthName()
RootFolder="Root\BugFix\"&bugfix_createdyear
ProjectName=bugfix_createdmonth
PrjName=RootFolder &"\"&ProjectName
End Select
call Get_Create_TestSet_Folder(TestTaledID,RootFolder,ProjectName,objTDConnection) 'Proje Klasoru olusturulur
TestTlpDsc=TestTaledID & "-" & TestTalepDesc
call Get_Create_TestSet_Folder(TestTaledID,PrjName,TestTlpDsc,objTDConnection) 'Proje altinda spesific alt klasor olusturulur.
MainPath= PrjName &"\"&TestTlpDsc
call Get_CreateTestSet(TestTaledID,MainPath,objTDConnection)
objTDConnection.Disconnect
Sonuc=1
end if
else
Sonuc=0
end if
End Function
'---------------------------------------------------------
Function Get_Create_TestSet_Folder(TestTaledID, MainPath,FolderName,objTDConnection) 'TestLab Altynda Folder Create Eder
Dim tsFolderPath,labTreeMgr,labFolder
Set TreeMgr = objTDConnection.TreeManager
Set TestF = objTDConnection.TestFactory
Set labTreeMgr = objTDConnection.TestSetTreeManager
Set labFolder = labTreeMgr.NodeByPath(MainPath)
On Error resume next
labFolder.AddNode(FolderName)
On Error resume next
labFolder.Post
Set TreeMgr = Nothing
Set TestF = Nothing
Set labTreeMgr = Nothing
Set labFolder=Nothing
End Function
'--------------------------------------------------------
Function Get_CreateTestSet(TestTaledID,MainPath,objTDConnection)
Dim i
p_TestSetName(0)="Smoke Test"
p_TestSetName(1)="Functional Test"
p_TestSetName(2)="BA/UAT Test"
p_TestSetType(0)="2-Smoke Test"
p_TestSetType(1)="3-Functional Test"
p_TestSetType(2)="6-UAT Test"
Set tstMgr = objTDConnection.TestSetTreeManager
On Error resume next
Set tsttr = tstMgr.NodeByPath(MainPath)
Set tsetFact = tsttr.TestSetFactory
On Error resume next
For i=0 to 2
Set TestSetName=tsetFact.AddItem(Null)
TestSetName.Name=p_TestSetName(i)
TestSetName.Field("CY_USER_01")= TestTaledID 'Test_Talep_ID
TestSetName.Field("CY_USER_04")=p_TestSetType(i)
TestSetName.Field("CY_USER_05")="TAC_USER"
On Error resume next
TestSetName.Post
if Origin_Type<>"B" and p_TestSetName(i)="BA/UAT Test" then
call CopyTestFromTestPlantoTestLab(objTDConnection,TestSetName) 'TestSetName->TL_test
end if
Next
End Function
'****************************'
'Create Date : 18 Eylul 2012 - Fatih Turkoglu
'Purpose : SOX UAT Gapleri icin gerekli olan standard bir test'in BA/UAT test icine test instance olarak
' otomatik atanmasini saglayan fonksiyondur.
' Input : TestTalepID : Log'lamak icin kullanilir.
' Input : objTDConnection : ALM ortamina Connection icin kullanilir.
' Input : MainPath : TestLab altinda projenin yaratildigi Path'dir.
' Input : testLibraryPath : TestLibrary altinda belirlene standard test templateinin bulundugu path'dir.
'*****************************'
Function CopyTestFromTestPlantoTestLab(objTDConnection,TL_Test)
Dim TestLibraryPath
TestLibraryPath="Subject\UAT Testleri"
Set treeM = ObjTDConnection.TreeManager
Set testLibraryF = treeM.NodeByPath(TestLibraryPath) 'Test Library altindaki dosyanin path'idir.
Set testF = testLibraryF.testFactory
On Error resume next
Set tfact = testF.AddItem(Null)
Set tlist = testF.NewList("")
Set testInstance = tlist.Item(1) 'Test Libray altindaki 1.ci test case template olarak kabul edilir ve alinir.
testName = testInstance.Name 'template test'in Name bilgisi.
testID = testInstance.ID 'template test'in ID bilgisi.
Set tstfact = TL_Test.TSTestFactory
Set mytst = tstfact.AddItem(testID)
mytst.Post
End Function
'--------------------------------------------------------
Function QC_Synchronize(strOriginType,strTTechProjectID,strProjectName,TestTaledID,strTestReqDesc,strWorkPackNo,strTaskID,strQC_Project)
On Error Resume Next
'wscript.echo "1"
Origin_Type=strOriginType 'P,F,B Degerlerinden biridir. Project FastTrack Bugfix
TestTalepDesc=strTestReqDesc
Dim strDomain
strDomain = "deleted"
Select Case strQC_Project
Case "deleted"
strDomain = "deleted"
Case "deleted"
strDomain = "deleted"
Case "WORKFLOW"
strDomain = deleted"
Case "deleted"
strDomain = "deleted"
end Select
Call Get_FolderCreate(strDomain,strQC_Project,strTTechProjectID,TestTaledID,Origin_Type,strProjectName)
wscript.echo Sonuc & HATA_MSJ 'Sonuc ekrana basilir.
EndTime = Timer()
'Call InsertlogText("Seconds: " & FormatNumber(EndTime - StartTime, 2))
wscript.Quit
On Error Resume Next
End Function
'QC_Synchronize(strOriginType,strTTechProjectID,strProjectName,TestTaledID,strTestReqDesc,strWorkPackNo,strTaskID)
'call QC_Synchronize("P" ,"02" ,"Aylin 1" ,"03" ,"Aylin2 project 1_Denemesi - Work Package 5" ,"Fatih3Work Package 5" ,"04","SPD")