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

WPF change window focus?

1 Answer 1501 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shaun
Top achievements
Rank 1
Shaun asked on 12 Apr 2018, 08:48 AM

Hi,

 

I'm reviewing the Telerik Testing Framework with WPF. I've managed to launch our application, find 'elements' by Automation ID and I'm able to click these. However, we open a text input window when clicking a button. The text input window is a 'child' window for the MainWindow, however, I'm unable to find any of the visible AutomationID's. Do I need to change to the 'child' window? If so how do I do this?

 

Thanks.

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 17 Apr 2018, 08:49 AM
Hi Shaun,

Thank you for reaching us out. 

Once a new wpf window is triggered you will need to first find it and then continue interacting with it. I hope the WPFWindow class and the WpfApplication class will be useful for you. 

To set the focus on a window you could use the following: 

Manager.ActiveApplication.GetWindow("yourWindowCaption").SetWindowFocus();

Please let me know if you would need further assistance on our end! Thanks! 

Regards,
Elena Tsvetkova
Progress Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Shaun
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or