Forum Discussion

TestQA1's avatar
TestQA1
Frequent Contributor
2 years ago

Getting value of the Window object

Hi, 

 

I have an object like Sys.Process("config").Window("*").Window("Afx:StatusBar:aa0000:8:10003:10", "", 1);

 

Now this object has some data shown on the status bar such as 'number of items' :0 Users: 9 etc.

How can I get the values of the number of items out of this object. 

The spy tool doesn't show any info. on the number of those captions/text. Is there any method that can be used to extract the text.

 

Thank you.

8 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    If you add the WndClass property name of you status bar object to MSAA (Project Settings -> Properties -> Open Applications -> MSAA), you should then be able to get more information

     

     

    • TestQA1's avatar
      TestQA1
      Frequent Contributor

      Thanks rraghvani I added the WndClass in the MSAA and it showed some captian details but not for all. Also, the text object was still not there as shown in your screenshot. The application I am testing is written in C++ and Sys.Process("config").Window("*").Window("Afx:StatusBar:aa0000:8:10003:10", "", 1) is a bottom statusbar that contains some caption/text such as 'Start' on the left side and 'Users:90' on the right side.

      I read the documentation but was unable to get the User count 90. However, I could see 'Ready' in spytool properties that's not something I need for my test at the moment.

       

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    If the Object Browser is not showing different sections of the status bar, then it could be a custom control. You might also need to add additional properties to MSAA.

     

    Enable this,

    Do you get more objects being exposed?

     

    • TestQA1's avatar
      TestQA1
      Frequent Contributor

      Enabling * also didn't work, but I enabled Win32 Controls in Object Mapping and now getting some additional properties name, but it shows error and no values.

       

       

      MSVC Class is: CStatusBar 

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Here's a small MFC application with "automation" enabled, which TC is able to identify the status bar

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    In the link you have provided, it states "To automate MFC controls in Visual C++ applications, you need to compile your tested application with debug information."

     

    You can get the OS symbol files for Windows, but this is different from the application that you are using.  The application that you are using may not contain pdb files, if it's a release. If it's open source, then you can compile and generate the pdb files.