This is a migrated thread and some comments may be shown as answers.

Same Elements used in Different Dialogs merging if used in same test

4 Answers 59 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Doug
Top achievements
Rank 1
Doug asked on 17 Apr 2014, 10:05 PM
Hey,

So WPF app has one Xaml for similar dialog. And because of this, all of the different ok and cancel buttons throughout the app have the same automation id. When I create a test that hits more than one of these dialogs, the test originally ties them to the correct dialog window and will pass. But when I close test studio and come back, it merges all of the steps that hit a cancel button into the same dialog (usually the first one hit in the test). So when the second dialog window comes up with a different title, the test is changing the primary target in the step properties to the first dialog hit in the test, causing a timeout, even though the elements in test studio are named differently and in the elements explorer are categorized under the correct title.

I can't figure out a workaround.

4 Answers, 1 is accepted

Sort by
0
Doug
Top achievements
Rank 1
answered on 17 Apr 2014, 10:06 PM
I'm on the latest version of Test Studio, I upgraded to the latest today.
0
Daniel Djambov
Telerik team
answered on 18 Apr 2014, 11:11 AM
Hi Doug,

Thank you for contacting us.

If I understand you correctly, when you record a new step within a new dialog with step pressing Cancel button and run the step it passes, but when you restart Test Studio and try to run it, this fails and when you select step and check its primary target it points to another one? And in Elements Explorer the Cancel button is present as element in both dialogs and there are 2 separate elements?

If you try to change the primary target of the step after the restart to the correct one, does it persist on restart?

Also in your situation it might be possible to use partial title match for the window/dialog page in Elements Explorer using '~' before the title or using a different find expression for the windows identification, so all windows merge and the element will always rely on the same window and steps referring it will find it no matter the title. You can explore this option also - here is some more information:
http://docs.telerik.com/teststudio/user-guide/troubleshooting_guide/test-execution-problems/silverlight/window-partial-match.aspx

Please tell me if any of the above suggestions worked. If not can you please provide us a simple project with tests that contain 2 different dialogs and description with the primary targets that are changed upon restart, so we can investigate your specific case and find a solution for you.


Regards,
Daniel Djambov
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Doug
Top achievements
Rank 1
answered on 18 Apr 2014, 07:17 PM
I think you have the problem correct. Yes, originally, the specific test steps point to the correct primary target and correct element in the elements explorer, but upon save and restart of test studio, the primary target is changed to a different dialog in the tests that use multiple dialogs. If I change the primary target back to the correct one, on restart I get the same problem. The steps will point to the correct element in the element's explorer under the correct dialog, but on restart, the step changes from pointing to the correct element in the elements explorer, to the incorrect element under the different dialog.

The "~" issue is a possible workaround that I'll try and let you know. As for the find expression for the window identification. That seems like it would work the best if I understand it correctly. Are you suggesting that I am able to use in the element find logic a way to identify the window as well? If so that should work, but I'm unsure as to what to type into the find logic to make that happen.

Thanks,

Peter
0
Daniel Djambov
Telerik team
answered on 21 Apr 2014, 12:29 PM
Hi Doug,

You can change the find logic for the pages and windows as well, but not from element's Find Expression Builder, but from Properties view for when selecting the specific page/window. Please refer to the article I have provided bellow and if you still have questions, please let me know.

In your case, if the different dialogs contain something dynamic in the beginning and something common in their titles, you can set the title of the dialogs to be "~[common title] - this will merge (create 1 single dialog) from all your different dialogs and the ok/cancel buttons will be the same for all dialogs and should be found in your different cases.

Regards,
Daniel Djambov
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Doug
Top achievements
Rank 1
Answers by
Doug
Top achievements
Rank 1
Daniel Djambov
Telerik team
Share this question
or