Forum Discussion

andygough1974's avatar
andygough1974
New Contributor
10 years ago
Solved

Changing Window Title breaks test

Hi All,



I am testing my WPF application, a click event opens a new window with the title "DebugWindow", i made a whole bunch of keyword tests on this window, then realised the window title was wrong, so i cnahed it to the correct name but now all my tets fail, TC cannot locate the window.



I thought i would convert my keyword test to a script and from there change the name of the title, but this is what th script looks like:




function ClickVolumeConfig()


{


  Aliases.VEParameterTool.HwndSource_LvTuningTool.LvTuningTool.ScrollViewer.DockPanel.Menu.WPFMenu.Click("Config|Volumes");


 Aliases.VEParameterTool.HwndSource_VolumeConfig object equals True.


  aqObject.CheckProperty(Aliases.VEParameterTool.HwndSource_VolumeConfig, "Enabled", 0, true);


}



This has no reference to the Window Title, and now I dont know how to fix my tests. Can anyone advise me please?



Andy

  • Hi Andrew.



    Have you checked name mapping?



    Most likely the window you changed title of was used in name mapping with certain caption (title) value.

    Double click NameMapping component in you project, find mapped window and check (on right pane) which properties TestComplete uses to recognize your window.



    Use Object Spy to get properties of your new window and remap it (you may simply remove old properties in  name mapping and add new one(s) or manually edit value of property (new name of caption/title).



    You may also change the way TC recognizes you window deleting caption and adding "required children" set of nested objects specific to this window only.



1 Reply

  • Hi Andrew.



    Have you checked name mapping?



    Most likely the window you changed title of was used in name mapping with certain caption (title) value.

    Double click NameMapping component in you project, find mapped window and check (on right pane) which properties TestComplete uses to recognize your window.



    Use Object Spy to get properties of your new window and remap it (you may simply remove old properties in  name mapping and add new one(s) or manually edit value of property (new name of caption/title).



    You may also change the way TC recognizes you window deleting caption and adding "required children" set of nested objects specific to this window only.