Forum Discussion

roko1024's avatar
roko1024
New Contributor
6 years ago
Solved

Work with C++ std::vector

Hello.

 

I am testing desktop application, wich using C++ std::vector. But I see in Object Spy only "zMyPair" (in fields) and "push_back" (in methods). How can I execute method "at" or "size"?

 

5 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Did you check Advanced View in Object Spy to see if what you need is there?

    • roko1024's avatar
      roko1024
      New Contributor

      Yes, I did. If I checked Basic View in Object Spy, I did not see "zMyPair" in Fileds.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    While TestComplete can access certain properties and methods of the tested application compiled with the debug info (check documentation for more details on what can be accessed and compilation requirements), its primary use area is data access and manipulation via UI.
    Direct access to structures like std::vector and its internal methods is more from the unit-testing area.

    Can you describe the use case that makes you access native structures of the tested application?

     

    • roko1024's avatar
      roko1024
      New Contributor

      Hi, Alex.

       

      In application, I tested, some data (for example information about buttons) is contained only in std::vector. If I want to click to some button, I need information about it bounds and caption. I want something like this:

      For example in programm:

      std::vector<ButtonInfo*> buttons;

      In JavaScript code:

      var caption = 'Save';

      var btnRect = null;

      for(var i = 0; i < buttons.size(); i++)

      {

          if (buttons.at(i).caption == caption)

          {

              btnRect = buttons.at(i).rect;

              break;

          }

      }