Forum Discussion

ah's avatar
ah
Occasional Contributor
7 years ago

Getting RowCount for DataTbl Grid

Hi There. I am on my first day of using TestComplete. I have set up a basic Keyword test where I am entering data into a grid. The grid shows up as "Aliases.MyApp.MenuPayroll.MDIClient.wndRTI_PrCl2.EditTbl.EditTable and has a WndClass of "DataTbl". 

 

I am trying to figure out how I get the count of the number of rows in the grid.

 

Thanks

 

Andrew

10 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    Your grid object should have a wRowCount property.

    • ah's avatar
      ah
      Occasional Contributor

      So I have tried Aliases.MyApp.MenuPayroll.MDIClient.wndRTI_PrCl2.EditTbl.EditTable.wRowCount but I get:

       

      Unable to find the object wRowCount. See Additional Information for details.

       

      The object with the specified attributes does not exist.

      Possible causes of the error



      Tested object:
      Aliases.MyApp.MenuPayroll.MDIClient.wndRTI_PrCl2.EditTbl.EditTable
      ()

       

      As you can see from the attached those properties aren't exposed.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    ah wrote:

    Hi There. I am on my first day of using TestComplete. I have set up a basic Keyword test where I am entering data into a grid. The grid shows up as "Aliases.MyApp.MenuPayroll.MDIClient.wndRTI_PrCl2.EditTbl.EditTable and has a WndClass of "DataTbl". 

     

    I am trying to figure out how I get the count of the number of rows in the grid.

     

    Thanks

     

    Andrew


    What baxatob and shankar_r said concerning row count...

     

    I feel generally obligated to point out that the purpose of the Aliases is so you can reference an object without having to reference the entire hierarchy of objects.  For example, in what you noted, you probably are not ever going to interact directly with either the MDIClient object or the WndRTI_PrC12 object.  So, you can, in your Alias editor, "drag" the tables to be direct children of the MenuPayroll and bypass those middle objects.  The Mapping itself maintains the hierarchy and other relationships, but the Alias then makes the object identification much more manageable and human readable.

    • ah's avatar
      ah
      Occasional Contributor

      tristaanogre wrote:

      What baxatob and shankar_r said concerning row count...

       

      I feel generally obligated to point out that the purpose of the Aliases is so you can reference an object without having to reference the entire hierarchy of objects.  For example, in what you noted, you probably are not ever going to interact directly with either the MDIClient object or the WndRTI_PrC12 object.  So, you can, in your Alias editor, "drag" the tables to be direct children of the MenuPayroll and bypass those middle objects.  The Mapping itself maintains the hierarchy and other relationships, but the Alias then makes the object identification much more manageable and human readable.



      Thanks. Ive just been through and moved everything around in the Name Mappings so its a little more intuitive.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Can you show us what the object shows in the way of properties in the object browser?
    • ah's avatar
      ah
      Occasional Contributor

      tristaanogre wrote:
      Can you show us what the object shows in the way of properties in the object browser?


      Sure. Sorry I had to blur some stuff as its mildly sensitive.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    Ok, the class (DataTbl) is not a recognized or supported class in TestComplete which is why you are running into those limitations.

    Can you provide more details about this class? What type of component is it? Etc? You might be able to map it in Object Mapping to go along with other table classes.

    As it is, RowCount is not an exposed property on tje object so you won't be able to get to it without some additional work.
    • ah's avatar
      ah
      Occasional Contributor

      tristaanogre wrote:
      Ok, the class (DataTbl) is not a recognized or supported class in TestComplete which is why you are running into those limitations.

      Can you provide more details about this class? What type of component is it? Etc? You might be able to map it in Object Mapping to go along with other table classes.

      As it is, RowCount is not an exposed property on tje object so you won't be able to get to it without some additional work.

      Hi Robert, as far as I know its just standard grid from Mscomctl.ocx. I will attempt to ask the developer of the product.

       

      I am not sure how to go about Object Mapping, is there anything you can point me towards?

       

      Cheers

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        The object you have mapped as "EditTable" has a parent object called EditTbl.  What kind of object is that?

         

        The reason I ask is that you may be looking at a child object of something that TestComplete might actually be able to work with.  If we can get a screenshot of the properties of that parent control, that might help.

         

        Something else that might help.... what is the architecture of the application you are testing?  Language it's written in? Platform?  I'm seeing, in your screenshot, that there are some components that are showing up as .NET but there are a LOT that are just "Window("class", "caption", 1)" kind of things.  TestComplete supports a WIDE variety of development platforms and component sets.  It would be helpful to know what kind of application you're working with so we can target the help better.

         

        In any case note in your screenshot above that your object is showing as a WndClass DataTbl.  That class, as far as I can tell, is not a recognized control by TestComplete.  So, natively, TestComplete cannot expose any of the internals.  In order to try (and this is not a guarentee that it will work), go to Tools -> Current Project Properties and find the Object mapping item in the properties tree.  Reference https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/improving/mapping.html and see what you can do about associating your class with an existing object.