'————————————————————————————————————————— ' Name: GetSiebListRows ' ' Purpose: Get the total number of rows of the List Object without the ' 1 of 10+, '11 of 20+' and so on.. ' ' Input: ' oSiebApplet - object reference to the SiebApplet hierarchy ' pValUINameSiebList - uiname of the SiebList object ' ' Output: ' Integer - number of rows ' ' Date: ' ' Author: '————————————————————————————————————————— Function GetSiebListRows( byRef oSiebApplet, pValUINameSiebList ) '————————————————————————————————————————— 'SiebList is a list object in a Siebel test automation environment Dim vCounter If InStr(1, pValUINameSiebList, "uiname") <> 0 Then pValUINameSiebList = Trim(Split(pValUINameSiebList, ":=")(1)) End If 'From QTP Ref: '_ The RecordCounter indicates the visible text of the record counter '_ string (for example: 1 - 7 or 7+) vCounter = oSiebApplet.RecordCounter Do If InStr(1, vCounter, "+") <> 0 Then oSiebApplet.SiebList("uiname:=" & pValUINameSiebList).NextRowSet vCounter = oSiebApplet.RecordCounter Else vCounter = oSiebApplet.RecordCounter Exit Do End If Loop If InStr(1, vCounter, "of") <> 0 Then vCounter = CInt(Trim(Split(CStr(vCounter), "of")(1))) End If GetSiebListRows = vCounter End Function '* Usage: ' Dim oSiebApplet, intRows ' Set oSiebApplet = SiebApplication("").SiebScreen("").SiebView("").SiebApplet("") ' ' intRows = GetSiebListRows( oSiebApplet, "uiname:=mySiebList" ) '————————————————————————————————————————— ' Name: Function SiebListFindValRow ' ' Purpose: Find a row from a column in which a given value (sVal) is located ' ' Input: ' oSiebApplet - object reference to the SiebApplet hierarchy ' pValUINameSiebList - uiname property's value for the SiebList object ' sColumnName - name of the column where the value is to be found ' sVal - value that is to be found ' ' Output: ' Integer ' 'Dependancy: ' SiebListRows ' ' Date: ' ' Author: ' ' Remarks: Make sure the columns name is correct - sometimes the header name ' is not the actual name. '————————————————————————————————————————— Function SiebListFindValRow( byRef oSiebApplet, pValUINameSiebList, sColumnName, sVal ) '————————————————————————————————————————— 'SiebList is a list object in a Siebel test automation environment Dim iRows, r, sData, sMsg If InStr(1, pValUINameSiebList, "uiname") <> 0 Then pValUINameSiebList = Trim(Split(pValUINameSiebList, ":=")(1)) End If '* Uses GetSiebListRows iRows = GetSiebListRows( oSiebApplet, pValUINameSiebList ) For r = 0 to iRows - 1 oSiebApplet.SiebList("uiname:=" & pValUINameSiebList).ActivateRow r sData = Trim(oSiebApplet.SiebList("uiname:=" & pValUINameSiebList)_ .GetCellText(sColumnName, r)) If sData = sVal Then SiebListFindValRow = r sMsg = "The following string: [" & sVal & "] was found in the " & _ sColumnName & " column of the Siebel List" Reporter.ReportEvent micDone, "Siebel List Value found", sMsg Exit Function End If Next End Function '* Usage: ' Dim oSiebApplet, intRow ' Set oSiebApplet = SiebApplication("").SiebScreen("").SiebView("").SiebApplet("") ' ' intRow = SiebListFindValRow( oSiebApplet, "uiname:=mySiebList", "Application ID", "TextIAmLookingFor" ) '————————————————————————————————————————— ' Name: Function SiebListFindValAllRows ' ' Purpose: Find all rows from a given column where a given value exists ' ' Input: ' oSiebApplet - object reference to the SiebApplet hierarchy ' pValUINameSiebList - uiname property's value for the SiebList object ' sColumnName - name of the column where the value is to be found ' sVal - value that is to be found ' ' Output: ' Object ' 'Dependancy: ' SiebListRows ' ' Date: ' ' Author: ' ' Remarks: Make sure the columns name is correct - sometimes the header name is not the actual name. '————————————————————————————————————————— Function SiebListFindValAllRows( byRef oSiebApplet, pValUINameSiebList, sColumnName, sVal ) '————————————————————————————————————————— 'SiebList is a list object in a Siebel test automation environment Dim iRowsTotal, iRowsRef Dim r, i, n, sData, arrArray Dim oDict: Set oDict = CreateObject( "Scripting.Dictionary" ) If InStr(1, pValUINameSiebList, "uiname") <> 0 Then pValUINameSiebList = Trim(Split(pValUINameSiebList, ":=")(1)) End If n = 0 'Calls the method: GetSiebListRows (see method above) iRowsTotal = GetSiebListRows( oSiebApplet, pValUINameSiebList ) iRowsRef = CInt(oSiebApplet.SiebList("uiname:=" & pValUINameSiebList).RowsCount) oSiebApplet.SiebList("uiname:=" & pValUINameSiebList).FirstRowSet For r = 0 to iRowsTotal - 1 i = r If iRowsRef <= r + 1 Then i = iRowsRef - 1 End If sData = Trim(oSiebApplet.SiebList("uiname:=" & pValUINameSiebList).GetCellText(sColumnName, i)) If sData = sVal Then oDict.Add n+1, r n = n + 1 End If oSiebApplet.SiebList("uiname:=" & pValUINameSiebList).NextRow Next Set SiebListFindValAllRows = oDict End Function '* Usage: ' Dim oSiebApplet, RowCollection ' Set oSiebApplet = SiebApplication("").SiebScreen("").SiebView("").SiebApplet("") ' ' Set RowCollection = SiebListFindValRow( oSiebApplet, "uiname:=mySiebList", "Application ID", "TextBeingSearchedFor" )