Page Object Model

3 posts, 0 answers
  1. Peter
    Peter avatar
    17 posts
    Member since:
    Mar 2017

    Posted 06 Apr 2017 Link to this post

    Hi, 

    Is it possible to generate Page Object model pattern for WPF application?

    Can you please write or give me one example?

     

    Regards,

    Peter

  2. Peter
    Peter avatar
    17 posts
    Member since:
    Mar 2017

    Posted 06 Apr 2017 in reply to Peter Link to this post

        public class ScreenHome : Page
        {
            private ArtOfTest.WebAii.Silverlight.FrameworkElement DailyMonitoringMenuItem => Application.Find.ByTextContent("Daily monitoring");
            private ArtOfTest.WebAii.Silverlight.FrameworkElement DailyTrackingMenuItem => Application.Find.ByTextContent("Daily tracking");

            public void ClickOnDailyTrackingMenuItem()
            {
                DailyMonitoringMenuItem.User.Click();
                DailyTrackingMenuItem.User.Click();
            }
        }

     

    Test:

            [TestMethod]
            public void TestPOM()
            {
                  ObjectRepository.SHome =  Manager.LaunchNewApplication(@"Desktop.exe");        
            }

     

    Error:

    Cannot implicitly convert type 'ArtOfTest.WebAii.Wpf.WpfApplication' to 'Aon.RiskAnalyzer.Desktop.TestProject.Screens.ScreenHome'

  3. Elena Tsvetkova
    Admin
    Elena Tsvetkova avatar
    938 posts

    Posted 11 Apr 2017 Link to this post

    Hello Peter,

    Thank you for contacting us. 

    From the shared error message it seems that the object SHome is not a WPF application and its type could not be converted to such. I suspect this could be a window from your application - please find additional details for the WpfWindow Class here

    I hope this will be useful to you to resolve the encountered error. 

    Regards,
    Elena Tsvetkova
    Telerik by Progress
     
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
     
Back to Top