03-05-2010, 08:22 PM
So this only returns 1 row - A
'msgbox A
'msgbox B
'msgbox C
So needless to say - when I use child object method - it only finds the first row as well
How can I traverse threw each row to get each one?
Code:
'A = Browser("Suppliers and Invoices").Page("Suppliers and Invoices").WebTable("Invoices").GetCellData(1,1)
'B = Browser("Suppliers and Invoices").Page("Suppliers and Invoices").WebTable("Invoices").GetCellData(1,2)
'C = Browser("Suppliers and Invoices").Page("Suppliers and Invoices").WebTable("Invoices").GetCellData(1,3)
'msgbox A
'msgbox B
'msgbox C
So needless to say - when I use child object method - it only finds the first row as well
Code:
Call ChildObjects_Example()
Sub ChildObjects_Example()
'The following example retrieves the collection of
'WebEdit objects in order to find a specific
'WebEdit object in a page and set a value for it.
Dim Search, ValueToSet, NumWE
'This is the value of the 'innertext' property for the WebElement object we want to find.
Search = ".*2010"
'Create a description object to help retrieve all WebEdit objects in a specific page.
Set oDesc = Description.Create()
oDesc("micclass").Value = "WebElement"
oDesc("class").Value = "x-grid3-row x-grid3-row-selected x-grid3-row-over"
'Retrieve all WebElement objects in this page
Set EditCollection = Browser("Suppliers and Invoices").Page("Suppliers and Invoices").ChildObjects(oDesc)
NumWE = EditCollection.Count
'Search for a specific WebEdit object and set its value
For i = 0 To NumWE -1
msgbox EditCollection(i).GetROProperty("innertext")
If EditCollection(i).GetROProperty("innertext") = Search Then
ValueToSet= Browser("Suppliers and Invoices").Page("Suppliers and Invoices").WebElement("Delete").Click
EditCollection(i).Set ValueToSet
No = Browser("Suppliers and Invoices").Page("Suppliers and Invoices").WebButton("No").Click
EditCollection(i).Set No
msgbox editcollection(i)
End If
Next
End Sub
How can I traverse threw each row to get each one?