Occasional Advisor
Unable to get SlvTable column name correctly for a particular scenario



I have a silverlight table in AUT, where i am unable to get the column names correctly using the below code.


QTP Code:

Set objColHeader = Browser("Browser").Page("Page").SlvWindow("Window").SlvTable("Table").Object.Columns
rcHeaderCount = objColHeader.Count
Msgbox rcHeaderCount
For i = 1 To rcHeaderCount
            colName = objColHeader.Item(i).Header
            Msgbox "Column Name ("& i &") -- '"& colName &"'"
            Print "Column Name ("& i &") -- '"& colName &"'"


SilverTable contains:

Rows - 1

Columns -10

Note: In the silverlight table, 2nd column contains a checkbox and two buttons and the 1st and remnaing columns has names


Please see the attached screenshot.


Actually when i am executing the abvoe code, QTP is returning the column names as follows:

1st Column name as - #

2nd Column name as - APN -- this should be return in 3rd iteration

3rd Column name as - Owner Names -- this should be return in 4th iteration




So on....


Coluld some one help me in getting the column names correctly according to the FOR loop iterations?

Moreover, i am using QTP 11.0 and Silverlight version 5.1.20913.0 in our AUT.