bulk primary target update

1 Answer 59 Views
WPF Testing
Richard
Top achievements
Rank 1
Richard asked on 26 Apr 2022, 05:22 PM | edited on 26 Apr 2022, 05:24 PM

Is it possible to perform bulk update for primary target? It looks like same element is not recognized by test with new version of the app, though element is exactly the same.

F.e.

/AppName/AppName_v1.2/WatermarkTextblock  vs /AppName/AppName_v1.3/WatermarkTextblock

manual update of individual element still assumes that test is re-recorded on new version of the app. Or maybe something else can be done to enable test to work between versions?

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 27 Apr 2022, 12:37 PM

Hello Richard,

Thank your for starting a discussion on the topic and sharing details about the changes in the element structure.

The Elements Explorer represents the structure of elements and the different hierarchy between them. It seems that the Application node is the same, but the Window node was changed after upgrading the application under test. The Window node is taken from the window title and it is stored in the Caption field property (see WPFCaption.jpg). 

You need to go through all Window nodes that have the updated title with new version of the product and change the Caption. While you are doing that, in order to prevent this issue after the next update, you can use the tilde "~" sign to indicate partial match of the window title and use a static name as the new Caption value (see WPFWindowCaptionContains.png).

There is a way (not recommended) to edit the Caption value of multiple Window nodes at the same time. You need to open all .tstest files that have references to those window nodes with a text editor and find the old value of the Caption field there. Replace it with the new value where needed and save the files. Please make sure to have a backup copy of your project before doing such manual changes and proceed with caution.

I hope the above information and suggestions will help you update the nodes in Elements Explorer and continue with the test automation with minimal maintenance.

Regards,
Plamen Mitrev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Richard
Top achievements
Rank 1
commented on 28 Apr 2022, 01:43 PM

Thank you for suggestions. I tried them, but unfortunately it's not working. Elements are still not recognizable.

Getting error like:

Unable to find the window '~AppName - 2022.4.27.1' inside application '\AppData\Local\Apps\2.0\VZ4TAN66.066\*\AppName.exe'
---- Current Windows: ----
AppName - 2022.4.28.1

Is anything else I can try?

Plamen Mitrev
Telerik team
commented on 28 Apr 2022, 01:56 PM

Hi Richard, I see that the current window's name is different than the Caption value. Even though you set it to look for partial match, there are still dynamic values in the name. I am referring to the version/build of the application - 2022.4.28.1.

You can try changing the Caption value to '~AppName' or '~AppName - 2022', so it is not affected by the minor version updates. The only thing to be careful of here is if there are multiple windows that will match the same Caption.

Try it and let me know if that worked for you.

Richard
Top achievements
Rank 1
commented on 28 Apr 2022, 02:38 PM

Actually, changing Caption to new name works. Thanks!
Plamen Mitrev
Telerik team
commented on 29 Apr 2022, 06:46 AM

I am happy to hear that, Richard. Have a great day ahead!
Tags
WPF Testing
Asked by
Richard
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
Share this question
or