Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
child object method??
#1
Not Solved
I have a web table where all of the objects are named the same.

There are 6 col's. Date, invoice Number, Amount, Date Paid, Edit or View and Delete.

There could be many rows. I want to collect the data from the rows. Then I want to Delete a record or edit a record. So in my case GetCellData is only working for the 1st row not any of the others. I get an error The specified cell does not exist. That said, what do I use to collect the data? ChildObject Method?

Can you give me an example?

Thanks
Reply
#2
Not Solved
Hi ,

Could you paste the code what ever you have tried?
Reply
#3
Not Solved
So this only returns 1 row - A

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?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object doesn't support this property or method takecharge 1 1,350 11-13-2019, 10:05 PM
Last Post: stormbringer
  does WebTable Object provides a method to get column number umer830 4 12,461 07-06-2018, 09:32 AM
Last Post: vijaychourasiya0109@gmail.com
  Child Object Not able to identified in Web Menu Link noor 0 1,648 01-21-2018, 04:44 PM
Last Post: noor
  Object doesn't support this property or method: 'window(...).window(...).winobject' senthil5683 1 3,499 07-04-2016, 07:08 PM
Last Post: venkatesh9032
  Selecting child node from Wintree object ajith123 2 5,002 02-26-2014, 02:12 AM
Last Post: supputuri

Forum Jump:


Users browsing this thread: 1 Guest(s)