Vous êtes sur la page 1sur 3

WebTable: A table containing a variable number of rows and columns. WebTable Methods: 1.

ChildObjects: Returns the collection of child objects contained within the object. Ex: Set webobj=Description.Create() webobj("micclass").value="WebElement" webobj("html tag").value="TD" Set webobject=browser("Browser").Page("Page").ChildObjects(webobj) webcount=webobject.count For i=0 to webcount-1 webelmt=webobject(i).Getroproperty("innertext") msgbox webelmt Next Set oDesc = Description.Create() oDesc("micclass").Value = "WebEdit"

'Retrieve all WebEdit objects from this page. Set EditCollection = Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").ChildObjects(oDesc) NumberOfEdits = EditCollection.Count Set oDesc = Description.Create() oDesc("micclass").Value = "WebEdit"

'Retrieve all WebEdit objects from this page. Set EditCollection = Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").ChildObjects(oDesc) NumberOfEdits = EditCollection.Count Set oDesc = Description.Create() oDesc("micclass").Value = "WebEdit"

'Retrieve all WebEdit objects from this page. Set EditCollection = Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").ChildObjects(oDesc) NumberOfEdits = EditCollection.Count Set oDesc = Description.Create() oDesc("micclass").Value = "WebEdit"

'Retrieve all WebEdit objects from this page. Set EditCollection = Browser("Book a Flight: Mercury").Page("Book a Flight: Mercury").ChildObjects(oDesc) NumberOfEdits = EditCollection.Count 2.ChildItem Set chd=Browser("Browser").Page("Page").WebTable("Cell 1") chd.ChildItem 2,2,"WebElement",0 3.ChildItemCount: Returns the number of objects of a specific type in a cell. msgbox chd.ChildItemCount(1,1,"WebElement") 4.RowCount: Returns the number of rows in the webTable. rwcount=Browser("Browser").Page("Page").WebTable("Cell 1").RowCount 5.ColumnCount: Returns the number of column in the webTable. colmncoun=Browser("Browser").Page("Page").WebTable("Cell 1").ColumnCount(1) 6.GetCellData: Retrieves the contents of the specified cell from the table. cellvalue= Browser("Browser").Page("Page").WebTable("Cell 1").GetCellData(2,2) 7.GetRowWithCellText : Returns the number of the first row found that contains a cell with the specified text. rowvalue=Browser("Browser").Page("Page").WebTable("Cell 1").GetRowWithCellText("Cell 8")

8.GetRoproperty: Returns the current value of the specified identification property from the object in the application. runvalue=Browser("Browser").Page("Page").WebTable("Cell 1").GetROProperty("innertext") 9.GetToproperty: returns the value from the test object's description testvalue=Browser("Browser").Page("Page").WebTable("Cell 1").GetToproperty("html tag")

10.SetToproperty : Sets the value of the specified identification property in the test object description. Browser("Browser").Page("Page").WebElement("WebTable").SetTOProperty "html tag","TD"