Sunday, November 21, 2010

This below example will retrieve specified table cell data

' This below example will retrieve specified table cell data
Set oDesc = Description.Create
'oDesc("innerText").Value = "one.*"
oDesc("micClass").Value = "WebTable"
'oDesc("innerText").Value  = True
Set allTables = Browser("Browser").Page("Page").ChildObjects(oDesc)
msgbox allTables.Count
For i=0 to allTables.Count-1
 'msgbox allTables.item(i).ToString()

 If i=2Then
  'msgbox "I value is "&i
  Set des = Description.Create
  des("outertext").Value = "one.*"
  des("outertext").RegularExpression = true
  val = Browser("Browser").Page("Page").WebTable(des).ColumnCount(i)
  msgbox "Coulmn Count is "&val
  celldata = Browser("Browser").Page("Page").WebTable(des).GetCellData(1,i)
  msgbox celldata
  msgbox Browser("Browser").Page("Page").WebTable(des).RowCount
 
 End If
Next
'msgbox objPro.RowCount  ' displays the no. of rows present in a web table
'msgbox objPro.ColumnCount(1) ' displays number of columns in the first row
'msgbox objPro.GetCellData(2,1)
'

' ///////////////////////////////////////////
'Set oDesc = Description.Create
''oDesc("micclass").value = "webbutton"    'this statement working, returned  1
'oDesc("micclass").Value = "webtable"
'oDesc("micclass").RegularExpression = True
'set obj = Browser("Browser").Page("Page").ChildObjects(oDesc)
'
''this loop displays only 1,1 info. it  wont displays the table name or properties
''For i=0 to obj.count-1
'' msgbox obj.item(i).ToString() 
''Next
'
'msgbox "Total webtables " &obj.Count
'' when there was static tables and independent table, means not nested table. For nested table this index will not work
''Set objPro = Browser("Browser").Page("Page").WebTable("index := 0")
'
'' working to identify , when there were nested tables
'Set objPro = Browser("Browser").Page("Page").WebTable("index := 1")
'
'msgbox objPro.RowCount  ' displays the no. of rows present in a web table
'msgbox objPro.ColumnCount(1) ' displays number of columns in the first row
'msgbox objPro.GetCellData(2,1)
'
''set res = Browser("Browser").Page("Page").Webtable("").GetTOProperties
'''msgbox res.count
''For k=0 to  res.count-1
'' msgbox res(k).Name
'' msgbox res(k).value
''Next

No comments:

Post a Comment

 

©2010 Software Testing powered by Free Blogger Templates | Author : Anand Satish