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

Page Object Model

2 Answers 20 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 06 Apr 2017, 09:35 AM

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 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
answered on 06 Apr 2017, 10:37 AM

    public class 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'

0
Elena
Telerik team
answered on 11 Apr 2017, 07:30 AM
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
 
Tags
General Discussions
Asked by
Peter
Top achievements
Rank 1
Answers by
Peter
Top achievements
Rank 1
Elena
Telerik team
Share this question
or