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

How to get the "real" WPF Elements?

1 Answer 20 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Slesa
Top achievements
Rank 1
Slesa asked on 25 Aug 2017, 08:50 AM

Hi all,

we just started to write UI tests, and we want to write them programmatically, e.g. w/o recording. With the setting of Automation IDs and the corresponding Find calls, this works as expected. On the other hand - this is the same result as with Selenium and the Appium driver. So I thought I could use the TTF to get a bit further.

Now what I wanted to to is to get a content element and observe its datacontext. Is that possible? Something like

var detailsView = SutSession.MainWindow.Find.ByAutomationId("DetailsRegion").As<ContentControl>();
detailsView.DataContext.ShouldBeOfType<FlightViewModel>();

Bat as far as I can see, I only get the TTF wrapper classes as a result, getn't I?

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 30 Aug 2017, 07:59 AM
Hello Jörg,

Thank you for reaching us out. 

There is DataContext property in the context of the Progress Testing Framework but it would probably return a string with the name of the type - FlightViewModel. That DataContext from the application under test is custom and is not known within the framework. 

The DataContext property in the framework is different than the one in the application under test and they could not be related to each other. 

Thank you for your understanding. 

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
Slesa
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or