How to get the "real" WPF Elements?

2 posts, 0 answers
  1. Slesa
    Slesa avatar
    1 posts
    Member since:
    Jun 2017

    Posted 25 Aug Link to this post

    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?

  2. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    610 posts

    Posted 30 Aug Link to this post

    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
     
Back to Top