Planning Support for the WPF Calendar Control
Supported on versions 2021 R1 and earlier
In this section, you study the behavior of the control that you want to support and the way OpenText Functional Testing recognizes it and interacts with it. You then determine what you need to customize in OpenText Functional Testing's behavior in order to enable creating test steps that are more meaningful and easier to maintain.
Run the sample WPF Calendar application and study its behavior
Double-click the <WPF_Silverlight_Add-in_Extensibility_installdir>\samples\WPFExtCalendarSample\Application\WpfCalendar.exe file. The Calendar application opens.

This application contains 3 controls:
A calendar display area with buttons: Microsoft.Windows.Controls.Calendar
A text label: System.Windows.Controls.TextBlock
An edit box displaying the selected date: System.Windows.Controls.TextBox
Study the application's functionality.
You can click the right and left arrows to go the next or previous month.
You can select a date in the calendar by clicking on the relevant day of the month.
You can view the selected date in the text box.
See how OpenText Functional Testing recognizes the controls
Use the Object Spy in OpenText Functional Testing to see how OpenText Functional Testing recognizes the controls in the Calendar application
Open OpenText Functional Testing, and open a GUI test.
Select Record > Record and Run Settings, and make sure that the selections in the Windows Applications tab enable OpenText Functional Testing to record and run tests on the calendar application.
Run the Object Spy
and spy on the WPF Calendar.OpenText Functional Testing recognizes the Calendar application as a WpfWindow. Within this window, it recognizes the Microsoft.Windows.Controls.Calendar control as a generic WpfObject and the System.Windows.Controls.TextBox as a WpfEdit object.
Additionally, within the in the Microsoft.Windows.Controls.Calendar control, OpenText Functional Testing recognizes the days as independent WpfButtons in the WpfWindow.
OpenText Functional Testing ignores other user interface elements contained in the Calendar control, such as the right and left arrows, and the month and year banner.
Add test objects for the Calendar control
Learn the Calendar control using OpenText Functional Testing, adding it to an object repository
Open the Object Repository.
Click the Add Objects to Local
button.Click on an area in the calendar.
Add additional objects to the local object repository by clicking the Add Objects to Local button and then clicking on different areas of the calendar. For example, click on the days, the text box, or the month and year banner.
OpenText Functional Testing learns the application as a WpfWindow. Within this window, it separately learns the calendar display area as a generic WpfObject and the Selected Date box as a WpfEdit object.
The days are learned as independent WpfButtons, but other user interface elements, such as the right and left arrows, and the month and year banner, are not learned at all.
Record a test on the Calendar control
Click Record
.Click on different areas in the calendar.
When you click on the right or left arrows, or on the month and year banner, OpenText Functional Testing records a generic click on the WpfObject, specifying the coordinates of the location you clicked.
When you click a day and select it, or when you click in the Selected Date box, nothing is recorded.
When you click in other areas of the application, OpenText Functional Testing records a generic click on the WpfWindow.
Conclusion: Develop a MyWpfCalendar Test Object Class
For functional testing purposes, the Microsoft.Windows.Controls.Calendar control should be represented in OpenText Functional Testing by one MyWpfCalendar test object.
The buttons within the Calendar control should not be treated as separate controls.
The Selected Date box is a read-only box, on which no user activity is possible and no steps are recorded. Therefore, the System.Windows.Controls.TextBox control does not have to be supported as part of the MyWpfCalendar test object, and does not need any customization for functional testing.
The MyWpfCalendar test object class should be based on the existing OpenText Functional Testing test object class, WpfObject, and extend its capabilities.
The MyWpfCalendar test object class should support calendar-related operations.
In this tutorial you develop support for the following test object methods: SetDate (default operation), Next, Previous, and a SelectedDate test object property.
User operations performed on the calendar's different user interface elements, should be interpreted and recorded as high-level operations on the calendar as a whole. For example: SetDate, Next, Previous, and so on.
The MyWpfCalendar test object class should support identification properties relevant for a calendar, such as is_today_highlighted.

