Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Funtion to get the status of the check box along with name of the web element
#1
Not Solved Exclamation 
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.

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
Reply
#2
Not Solved
Can you try this.

Code:
For i = 1 To Rows - 1
WebCheckBoxName=WebTableCount.GetCellData(i,2)
Reporter.ReportEvent micDone,"Name of the Check Box=   "&WebCheckBoxName
Next

End Function
Reply
#3
Not Solved
I think when We are referencing a test object in a Table we should use ChildItem table method to get access to that Object. But we should be careful about exact Row and Column numbers where the Test Object Resides other we can't get access to Childobjects in Table. Try the following code.. if it fails try to alter the Column value and try.


Code:
For i = 2 To Rows

Set Item1 = WebTableCount.ChildItem(i, 1, "WebCheckBox", 0)
msgbox  Item1.GetRoProperty("name")

Next

Thanks,
Vijay
Reply
#4
Not Solved
I tried both script, but no luck. Anyway thanks for your help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to close/restart UFT in "Not responding" status with AOM script CharlieMadrid 0 1,060 05-21-2020, 08:46 PM
Last Post: CharlieMadrid
  Unable to select WebFile element upadhyay40 5 7,509 06-28-2016, 04:38 PM
Last Post: aakash
  Auto complete for Web Edit box branjitk 2 5,710 12-20-2014, 09:31 PM
Last Post: supputuri
Question Is Reporter ignoring the status of steps? dlaureano 3 3,410 06-05-2014, 01:38 PM
Last Post: Jay
  QTP identifying WebList as WebEdit and an Element passion77 3 8,118 01-27-2014, 10:21 PM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)