Ask a Question

Desktop Automation Window Update

SOLVED
LonewolfQA
New Contributor

Desktop Automation Window Update

I am currently attempting to automate my companies software however every time there is a new build the program window name is being incremented for example if I record an automation the application window will be lw00000 but if I am to update the program it will rename the window to lw00001 making TestComplete unable to locate the object in the renamed window.  I have tried updating the the window name in the test which it does successfully but does not update the commands that are to be performed in the test.  Each command has to be updated individually, which is slower than re-recording a new test.  Is there a way that I can update the window name and keep the commands that are performed within that window?  Thanks.

7 REPLIES 7
shankar_r
Community Hero

It would helpful to answer if you provide some screenshots of window and it's object browser properties 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

tristaanogre
Esteemed Contributor

Something else to look at has to do with the mapping... and this is probably where your solution is going to be.

 

If the properties being used for identifying the window contain values that change every build, then you may need to either consider using different properties for identification or use wildcards in the property values to account for the variability.

 

In your example, you mention a value that changes from lw00000 to lw00001.  If that value is one of the properties used for identifying the object, you could replace that value in your NameMapping to lw*.  This will make that property match no matter what application build it is.

 

Of course, this is a simplistic answer but it is one thing to consider.  As @shankar_r suggested, we can give more directed answers if we can see the object browser properties of the window in question.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hello Robert first of all thank you very much for your reply.  I am unsure of how much of my companies information I can show so I am hoping that if give you an example of two test that are supposed to do the same thing but have the incremented window values.  Both tests are designed to log into our companies product using our admin login.  The parts that I redacted are the login credentials.  The full object path of the first click (highlighted line) is  Aliases.lwrms.wndLwRMS9c000000.LwRMS9c000000.LwRMS9c000000 for this first screenshot.

Login_1.png

 

In Login 2 that same highlighted line's full object path is Aliases.lwrms.wndLwRMS9c0000002.LwRMS9c000000.LwRMS9c000000.

 

 

login_2.png

I attempted to make the object paths Aliases.lwrms.wndLwRMS9c*.LwRMS9c000000.LwRMS9c000000 which I believe is what you were trying to get at but it would not accept that.  I am fairly unfamiliar with test complete and doing my best to learn more.  I will talk to my boss about trying to get you more information. If you need more information please ask.  Thanks again.

Hi Shankar please see my reply on Roberts post,

 

Thanks!

The wildcarding is not done in the test case itself but in the NameMapping.

 

In your project explorer, double click on the node that says "NameMapping" and, in the Aliases section, find where those objects are.

 

Basically, you need to modify the mapping criteria for your objects so that they handle the dynamic identification easier.

For more info, https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/mana...


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Richard,

 

Thank you very much, this has solved this issue for me my hope is that with that ambiguous identifier that it will not come back to hurt me during further automation of the product since our product can open more than one window.  If there are further issues I will reply on this thread.  

 

Thanks Again,


@LonewolfQA wrote:

Richard,

 

Thank you very much, this has solved this issue for me my hope is that with that ambiguous identifier that it will not come back to hurt me during further automation of the product since our product can open more than one window.  If there are further issues I will reply on this thread.  

 

Thanks Again,


That is a risk, obviously, in the wildcarding.  It could be that the property that you wildcarded may not be the best one to use for your purposes.  It could be that you need to utilize a different property or some other properties in combination with that one to make sure that the object is properly and uniquely identified.  It will take some practice, some trial and error, to get it 100%.  Until then, this should work.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: