01-19-2010, 12:54 PM
Hi Umer,
Follow the below steps.
Step1: Add the required 'WebTable' Object into Obj.Repo
Step2: Retrieve the row count of the webtable.
Step3: Loop thru all the rows & retrieve required cell's data using 'GetCellData' method & Validate the current link text with expected link text.
Step4 : If the required link text is found in 'i'th row, then use 'ChildItem' Method & select the correspoding CheckBox present in the same row & Exit out of the Loop.
Refer the below example code:
Follow the below steps.
Step1: Add the required 'WebTable' Object into Obj.Repo
Step2: Retrieve the row count of the webtable.
Step3: Loop thru all the rows & retrieve required cell's data using 'GetCellData' method & Validate the current link text with expected link text.
Step4 : If the required link text is found in 'i'th row, then use 'ChildItem' Method & select the correspoding CheckBox present in the same row & Exit out of the Loop.
Refer the below example code:
Code:
Expected_Link="DEC 3"
rc= Browser("projectCentre QTP:TEST-AT:").Page("projectCentre QTP:TEST-AT:").Frame("RegRegRegFrame").WebTable("...").RowCount
For i=1 to rc
Table_linkText=Browser("projectCentre QTP:TEST-AT:").Page("projectCentre QTP:TEST-AT:").Frame("RegRegRegFrame").WebTable("...").GetCellData(i,3)
If (Expected_Link=Table_linkText) then
Browser("projectCentre QTP:TEST-AT:").Page("projectCentre QTP:TEST-AT:").Frame("RegRegRegFrame").WebTable("...").ChildItem(i,1,"WebCheckBox",0).Set "ON"
Exit For
End if
Next