Forum Discussion
alinder
14 years agoContributor
One thing to consider is that by trying to excise Name Mapping you are discarding a lot of TestComplete's functionality and usefulness at recognizing objects that would otherwise be inconsistent in characteristics.
Consider if something like this would work for your needs:
set wnd_Login= Aliases.DMS.LogInWnd
set
txt_Login_UserName=Aliases.DMS.LogInWnd.userName
set
txt_Login_Password=Aliases.DMS.LogInWnd.passwordBox
set
cmb_Login_Environment=Aliases.DMS.LogInWnd.EnvironmentCbo
Then use Name Mapping and Aliases to define all the above Aliases. This way you have a point of abstraction if you need to account for dramatic change in the application under test in addition to the option of updating the Name Mapping itself in response to dramatic change.
On your initial question, you might also look at using Find or FindChld, but these methods are slow in performance, and you need to have the object you want to identify on-screen at the time. You would have to call your custom solution to re-initialize all your objects when you went to a new screen or dialog to get the ones that are currently displayed, and I don't think you'd want to do that
Consider if something like this would work for your needs:
set wnd_Login= Aliases.DMS.LogInWnd
set
txt_Login_UserName=Aliases.DMS.LogInWnd.userName
set
txt_Login_Password=Aliases.DMS.LogInWnd.passwordBox
set
cmb_Login_Environment=Aliases.DMS.LogInWnd.EnvironmentCbo
Then use Name Mapping and Aliases to define all the above Aliases. This way you have a point of abstraction if you need to account for dramatic change in the application under test in addition to the option of updating the Name Mapping itself in response to dramatic change.
On your initial question, you might also look at using Find or FindChld, but these methods are slow in performance, and you need to have the object you want to identify on-screen at the time. You would have to call your custom solution to re-initialize all your objects when you went to a new screen or dialog to get the ones that are currently displayed, and I don't think you'd want to do that