Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
does WebTable Object provides a method to get column number
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
I have a web table object in my application where i have to search for an element get its row and column number. Once i gett the row number
using
GetRowWithCellText Method "

Next I want to know about column number but i could not find any function to get column number because i want to use object.GetCellData (Row, Column)
method to get complete cell text and verify wheather it contains my required text or not.
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
once you get the row using GetRowWithCellText, loop through all the columns of webtable and find the column in which your text is there

Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
Thanks for quick answer.
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
Umer,
My 2 cents would you be to ask not to use getrowwithcelltext as the only option. In a webtable if you have rows with data which are duplicate then you will get the data of the first one and not the second one.

IF i were you then i would do the below,

1. Get the Row Count.
2. Get the Column Count
3. Loop through the Rows & columns using the GetCelldata(r, c).
4. From the CellValue obtained match it against the value you need.
5. Report Pass
5. Exit the Loop at that point.
6. If not found Report Fail.

Go ahead and write the code based on the above logic and you will get what you need.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
(12-09-2009, 11:04 AM)umer830 Wrote: I have a web table object in my application where i have to search for an element get its row and column number. Once i gett the row number
using
GetRowWithCellText Method "

Next I want to know about column number but i could not find any function to get column number because i want to use object.GetCellData (Row, Column)
method to get complete cell text and verify wheather it contains my required text or not.

You can get the Column name with column number from below code:
Call getColumnName("Employee Name")
Function getColumnName(ColValue)
    Col_Names=Browser("").Page("").WebTable("").GetROProperty("column names")
        arr=split(Col_Names,";")
        counter=0
        For Iterator = 0 To UBound(arr) Step 1
            Found=0
            If arr(Iterator)=ColValue Then
                Found=1
                Print "Found"
                'this is for column possition
                counter=counter+1
                Exit For
            Else
                counter=counter+1
            End If
        'Next
    Next
    print counter
    If Found=1 Then
        print "Column Possition:"&"="&counter
    Else
        print "Column does not exit"
        
    End If
    getColumnName=ColValue
    
End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object doesn't support this property or method takecharge 1 1,597 11-13-2019, 10:05 PM
Last Post: stormbringer
  Link in a webtable in a webtable Soulwalker 1 2,862 07-19-2017, 01:44 PM
Last Post: Ankur
  Object doesn't support this property or method: 'window(...).window(...).winobject' senthil5683 1 3,717 07-04-2016, 07:08 PM
Last Post: venkatesh9032
  Fetching total number of records inside a webtable vidya2k2 2 3,960 06-15-2015, 02:55 PM
Last Post: venkatesh9032
  Webtable actions are not getting recorded, but ObjectSpy is able to identify webtable sahilarora2000 2 3,933 06-13-2014, 04:27 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)