Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
132
In QTP 9.1 How do I access the rowcount of my UltraWinGrid object.
posted

I am using QTP 9.1 to automate test cases.The application has an UltraWinGrid and am trying to find a row using a search strig.I want to find the rowcount to loop through the rows to find out my search string.When I used rowcount property,I got a message saying this property is not supported.

Please let me know how do I go about that.

Thanks,

RamPriya

Parents
No Data
Reply
  • 6729
    Verified Answer
    Offline posted

    Hi Rampriya,

    You can try the following to get the number of rows in the grid:

    rowcount = SwfTable("...").GetNAProperty("Rows.Count")

    Then to access each row:

    For I = 0 TO rowcount-1

    Set currentRow = SwfTable("...").GetNAProperty("Rows["+CSTR(I)+"]")

    ' To get a specific cell text for the current row

    cellText = SwfTable("...").GetNAProperty("Rows["+CSTR(I)+"].Cells[0].Text")

     Next

    Hope that will help

    Regards,

    Ammar

Children