04-21-2009, 02:13 AM
Hi everyone,
Please help me in writing a function in QTP. I am testing a web page which has so many check boxes (more than 50) with different name for each check box like chkbox_1, chkbox_2, chkbox_3 and so on. I writing a function to check the status of the check box (Checked or Unchecked) along with the name of the check box (like chkbox_1, chkbox_2).
I am able to get the status of the check box in the output but I am not able get the name of the check box in the output using the below function.
Please let me know where am I doing wrong, I would appreciate if any one can help me in writing this function.
Thanks a lot in advance.
Divyamann
Please help me in writing a function in QTP. I am testing a web page which has so many check boxes (more than 50) with different name for each check box like chkbox_1, chkbox_2, chkbox_3 and so on. I writing a function to check the status of the check box (Checked or Unchecked) along with the name of the check box (like chkbox_1, chkbox_2).
I am able to get the status of the check box in the output but I am not able get the name of the check box in the output using the below function.
Code:
Public Function FindWebTable(ByVal sBrowserName, ByVal sPageName,ByVal sWebTableName)
Set oDesc2 = Description.Create()
oDesc2("micclass").Value = "WebTable"
oDesc2("name").Value= sWebTableName
Set WebTableCount=Browser("title:="&sBrowserName).Page("title:="&sPageName).WebTable("name:="&sWebTableName)
Rows=WebTableCount.RowCount
msgbox Rows
For i = 1 To Rows - 1
WebCheckBoxName=WebTableCount.GetCellData(i,2)
Reporter.ReportEvent micDone,"Name of the Check Box=",WebCheckBoxName
Next
End Function
Please let me know where am I doing wrong, I would appreciate if any one can help me in writing this function.
Thanks a lot in advance.
Divyamann