Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to click on WebElement within a WebTable
#1
Solved: 8 Years, 1 Week ago
I am having some difficulty trying to automate clicking a WebElement that resides within a WebTable.

I have no problems being able to find the row and column with the webtable that contains the value I wish to click on. The problem is the clicking part....

Below is my code for finding the row and column within the WebTable. The problem is with using ChildItem(iRow, iCol, "WebElement", 0). It doesn't want to return a value. It keeps giving me a Object Error.

ANy help would be appreciated!

Thanks!

Code:
row_count=Browser("title:= Supplier T-File Tracking.*").Page("title:= Supplier T-File Tracking.*").WebTable("html id:= tfiletable").RowCount
col_count=Browser("title:= Supplier T-File Tracking.*").Page("title:= Supplier T-File Tracking.*").WebTable("html id:= tfiletable").ColumnCount(row_count)

For iRow = 1 to row_count
   For iCol = 1 to col_count
     iReturn =  Browser("title:= Supplier T-File Tracking.*").Page("title:=Supplier T-File Tracking.*").WebTable("html id:= tfiletable").ChildItemCount(iRow,iCol,"WebElement")
    
     strReturn =  Browser("title:= Supplier T-File Tracking.*").Page("title:= Supplier T-File Tracking.*").WebTable("html id:= tfiletable").GetCellData(iRow,iCol)

     Print "This is the cell data: " & strReturn
  
     If strReturn = "READY FOR T-FILE FOCAL" Then
         MsgBox "I found the cell numbers: " & " Row: " &  iRow & " Column: " & iCol
         nCnt = Browser("title:= Supplier T-File Tracking.*").Page("title:= Supplier T-File Tracking.*").WebTable("html id:= tfiletable").ChildItemCount(iRow, iCol, "WebElement")
        Browser("title:= Supplier T-File Tracking.*").Page("title:= Supplier
     End If
     If iReturn > 0 Then
        Print "This is row: " & iRow & " and column: " & iCol & " ChildItems = " & iReturn
     End If
   Next
Next

I'm guessing it's because the ChildItemCount value = 0 is why the Object Error appears when I try to do this with the object:

Code:
iChildCnt = Browser("title:= Supplier T-File Tracking.*").Page("title:= Supplier T-File Tracking.*").WebTable("html id:= tfiletable").ChildItemCount(intRow, intColumn, "WebElement")

Set oPartNumberLink = Browser("title:= Supplier T-File Tracking.*").Page("title:= Supplier T-File Tracking.*").WebTable("html id:= tfiletable").ChildItem(intRow, intColumn, "WebElement", 0)

oPartNumberLink.Highlight

I guess I don't understand why ChildItem Count is returning 0 when I know for a fact that is the cell row and column of the value I want.
Reply


Messages In This Thread
Trying to click on WebElement within a WebTable - by fridlek - 08-15-2013, 02:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Gain data from a webtable inside a webtable AndyM 1 1,949 07-12-2018, 08:36 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)