Forum Discussion

kamilpavlicko's avatar
kamilpavlicko
New Contributor
9 years ago
Solved

Window Title Issue

Hello everyone,

 

I am brand new one with testcomplete, but I am already done with a few tests (on Java Desktop application). 
Everything went well (including logs, script test, mapping object, vice versas .. )

The problem occured when I wanted to test the same test (test suite) on different application. Different application is meant, that it is fully the same Java application as the first one, but it has different Window title
So when I have mapped object from first application, it gaves me (full name) like this: 

Sys.Process("xxxmanager").SwingObject("VDBMSecurityAdminFrame", "FIRST APPLICATION TITLE", 0).SwingObject("JRootPane", "", 0).SwingObject( ....

and the second:

Sys.Process("xxxmanager").SwingObject("VDBMSecurityAdminFrame", "SECOND APPLICATION TITLE", 0).SwingObject("JRootPane", "", 0).SwingObject( ....

So albeit it is everything the same, titles are different, so test complete does not recognize object in second application.

 

Have someone any ideas how to fix it ? I had an idea that I could avoid this by writing the general test script (python) and then put the title as a variable manually. But for testing I prefer keyword tests (better maintainance).

Please let me know, if there is some "trick or hack" to fix it. I was success with heuristic match on free open-source applications, so it was suprise for me, that paid tool does not have this feature.

 

 

Thank you in advance :)

Kamil

 

  • djadhav's avatar
    djadhav
    9 years ago

    Make sure the object exists.

     

    1) Right click to access the NameMapping editor.

     

     

    2) Choose 'Conditional Mode'

     

     

    3) Here you can map the object with Title 1 OR Title 2

  • Even if I have no property WndCaption in my Java application. Definitely I was successful with changing or making condition on AWTComponentAccessibleName.

     

    Thank you guys very much for solution :)

     

     

8 Replies

  • m_essaid's avatar
    m_essaid
    Valued Contributor

    hi,

     

    use the object spy, specify that you want ALL the properties and methods.

     

    spy the window... you should have a caption property which have the title you want.

     

    then, map with several properties (class, name, and for example caption). by doing this you should have different mapped object for the different windows.

  • I am not sure if I got the point. 

    Your advice is to check/find out window's title and make sure what window I'm mapping in, and then map each buttons/tables etc.

    But I need to run the same test suite on different application window's title. So I dont want to remap all stuff including in test case. I want to run exactly the same and maybe rename or change window's title somewhere in configuration, or so.

     

    Is this possible ? 

     

      • kamilpavlicko's avatar
        kamilpavlicko
        New Contributor

        Yes, I found it already in documentation, but when I open name mapping editor, I can see my xxxmanager editor, however I dont have any checkbox or view for condition. I have only Extended find property there. Is there any step in configuration to make it visible ?