Wednesday, June 16, 2010

Selecting the WebTable Cells behaves as webelement

'Cell Values behave as Webelement and consider the total webtable cells as same WebElement. We can use below code and select the particular expected row and cell

RC1=Browser("Browser").Page("Page").WebTable("WebTable").GetRowWithCellText("text")
wait(3)
rc=Browser("Browser").Page("Page").WebTable("WebTable").RowCount
If rc>0 Then
var=Trim(Browser("Browser").Page("Page").WebTable("WebTable").GetCellData(RC1,Column))
End If

Set oDesc=Description.Create()
oDesc("micclass").Value="WebElement"
oDesc("innertext").Value=cstr(var)
oDesc("innerhtml").Value=cstr(var)
oDesc("outertext").Value=cstr(var)
oDesc("html tag").Value="TD"
Set ChldObj=Browser("Browser").Page("Page").WebTable("WebTable").ChildObjects(oDesc)
If ChldObj.count>1 Then
ChldObj(0).click
wait(3)
End If

No comments:

There was an error in this gadget