Ask a Question

Getting value of the Window object

TestQA1
Frequent Contributor

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 8
rraghvani
Trusted Contributor

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

 

rraghvani_0-1680010438776.png

 

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
Trusted Contributor

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,

rraghvani_0-1680174006545.png

Do you get more objects being exposed?

 

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.

 

TestQA1_0-1680178597288.png

 

MSVC Class is: CStatusBar 

 

rraghvani
Trusted Contributor

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

rraghvani_0-1680192293272.png

 

TestQA1
Frequent Contributor

I will look into it again. Do you think it could be something related to text recognition plugin or adding any property in text recognition page in Properties? I'm not sure if I can get that if it's not our paid package.

TestQA1
Frequent Contributor

Looks like something with MFC Debug Info. 

Found this https://support.smartbear.com/testcomplete/docs/app-testing/desktop/visual-c/preparing/mfc-debug-inf... 

Can this approach be used with any Open Application like any desktop app that we don't develop ourselves and purchased it to handle some of our software tasks?

rraghvani
Trusted Contributor

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.

cancel
Showing results for 
Search instead for 
Did you mean: