Forum Discussion

scambias's avatar
scambias
Contributor
6 years ago

Stingray grid method GetRowCount, called by vbscript, sometimes is not found

Hi all

 

I am testing a desktop c++ application which contains a stingray Grid.

As suggested by SmartBear, I built stingray dll with debug information and therefore I can select, using the Object Spy, the grid, map into namemapping and therefore make it available using and Alias.

In the Object Spy I can see all the object methods and among them, the GetRowCount().

 

If I want to access to this grid method from vbscript I sometimes get that this is not available (I get a "searching for GetRowCount" message) and then I get a timeout stop. Most of the times it works.

 

I thought it could be due to the grid not "available" or "well loaded yet", so I inserted some delays before accessing the method, a grid.Click call, a check on Grid.Visible attributes, but still randomically I get that issue.

 

The grid is there, having so many rows and all I want is to know their number!!!

 

Somebody can help me on finding a way to make it 100% working?

Thank you in advance

Silvio

 

7 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Can you post copy/paste of your code you're executing?  Or screenshots of the keyword test steps that you're executing?  That may help us help you better.

  • Hi,

    here is the code's lines trying to access the GetRowCount and wColumnCount property of the grid:

     

    Dim grid
    if (gridName <> "") Then
    Execute ("set grid = " & gridName)
    end if
    dim rowCount, colCount, i, j
    if not grid is nothing then

    'rowCount = CInt(grid.wRowCount)
    rowCount = CInt(grid.GetRowCount)
    colCount = CInt(grid.wColumnCount)

     

    end if

     

    In the attachments you can find the screenshot of the error showed and the grid I'm trying to work with.

    Thank you for the answer.

  • Hi,

    here is the code's lines trying to access the GetRowCount and wColumnCount property of the grid:

     

    Dim grid
    if (gridName <> "") Then
    Execute ("set grid = " & gridName)
    end if
    dim rowCount, colCount, i, j
    if not grid is nothing then

    'rowCount = CInt(grid.wRowCount)
    rowCount = CInt(grid.GetRowCount)
    colCount = CInt(grid.wColumnCount)

     

    end if

     

    In the attachments you can find the screenshot of the error showed and the grid I'm trying to work with.

    Thank you for the answer.

  • Moreover, when this issue appears, if I find the object in the objectbrowser I noticed that the "Advanced view" is showing just "basic view" properties and members.

    It's like TestComplete misses the debug information on that grid, which is not only there but it's appearing again on another run of the test.

    It's something randomic, somehow.

    Please see the attached snapshot.

      • scambias's avatar
        scambias
        Contributor

        Hello Martin,

         

        thanks for your help.

        I've actually read that page and noticed that there is no documented section about the method/property GetRowCount, but still that method appears among the methods list. The thing is that sometimes it does not, together with some more others (which are listed in that page, i.e. wColumnCount, wRowCount).
        What suprises me is that this happens randomically :/ as it has not been able (in some circumstances I don't know about) to "load" all the debug info or to build the advanced table of prop/meth