How to set the radio button by childitem?
To set the radio button ON/OFF inside a webtable,
E.g.,
1) Set oTable = Browser("Browsertitle").Page("pagetitle").WebTable("new")
Roww = oTable.GetRowWithCellText("Test")
ColumnInd = 1
Set Pointer = oTable.ChildItem(Roww ,ColumnInd,"WebRadioGroup",0)
Pointer.FireEvent "onclick"
If Pointer.GetRoProperty("checked") <> 1 Then
Reporter.ReportEvent"Step 14","Radio button corresponding to test is not checked"
End If
Set Pointer = Nothing
Set oTable = Nothing
Note : Similarly we can perform the required operation inside the webtable using ‘Childitem’ method.
Code with childitemcount:
To perform set operation with chilitemcount method,
E.g.,
Set obj = Browser(“Bro”).Page(“page”).Webtable(“wtbl”)
If obj.ChildItemCount(1,1,"WebEdit")>0 Then
obj.ChildItem(1,1,"WebEdit",0).Set "QTP"
End If
E.g.,
1) Set oTable = Browser("Browsertitle").Page("pagetitle").WebTable("new")
Roww = oTable.GetRowWithCellText("Test")
ColumnInd = 1
Set Pointer = oTable.ChildItem(Roww ,ColumnInd,"WebRadioGroup",0)
Pointer.FireEvent "onclick"
If Pointer.GetRoProperty("checked") <> 1 Then
Reporter.ReportEvent"Step 14","Radio button corresponding to test is not checked"
End If
Set Pointer = Nothing
Set oTable = Nothing
Note : Similarly we can perform the required operation inside the webtable using ‘Childitem’ method.
Code with childitemcount:
To perform set operation with chilitemcount method,
E.g.,
Set obj = Browser(“Bro”).Page(“page”).Webtable(“wtbl”)
If obj.ChildItemCount(1,1,"WebEdit")>0 Then
obj.ChildItem(1,1,"WebEdit",0).Set "QTP"
End If
Comments
Post a Comment