10-08-2009, 08:05 AM
Hi everybody,
As I am just a Beginner in QTP. I got a question here.
I have found a function and the function run properly.
However, I don't know how to set the Qtp to continues with the scripts when "intRows = 1". If "intRows" doesn't equal to 1, then an error should pop-put.
Can anyone help ?
Here is the function I found.
Function GetSiebListRows( byRef oSiebApplet, pValUINameSiebList )
'—————————————————————————————————————————
As I am just a Beginner in QTP. I got a question here.
I have found a function and the function run properly.
However, I don't know how to set the Qtp to continues with the scripts when "intRows = 1". If "intRows" doesn't equal to 1, then an error should pop-put.
Can anyone help ?
Here is the function I found.
Function GetSiebListRows( byRef oSiebApplet, pValUINameSiebList )
'—————————————————————————————————————————
Code:
'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
Dim oSiebApplet, intRows
Set oSiebApplet = SiebApplication("Siebel Energy (CMS DR)").SiebScreen("Agreement").SiebView("Agreement Charges").SiebApplet("Invoices")
intRows = GetSiebListRows( oSiebApplet, "uiname:=List" )