Share this page

SetDate Method (ICalendar)
Sets the date of a WPF calendar or of a date picker.

C# Syntax

    void SetDate(
       DateTime date
    )

Parameters

date
  The date to set.

Example

    // This example locates and sets the date of the date picker control.
    private void ChooseFlightDate()
    {
        // Identify the date picker control. The date picker is identified through the main window and not directly from the Flight GUI applications.
        var flightDatePicker = Desktop.Describe<IWindow>(new WindowDescription
        {
            ObjectName = @"OpenText MyFlight Sample",
            FullType = @"window",
            WindowTitleRegExp = @"OpenText MyFlight Sample"
        }).Describe<ICalendar>(new CalendarDescription
        {
            ObjectName = @"datePicker"
        });
        // Select the flight date.
        flightDatePicker.SetDate(new DateTime(year:2025, month:8, day:1));
    }

Tips to improve your search results... OpenText™ Functional Testing for Developers .NET SDK Version: 25.2 OpenText™ Functional Testing for Developers SDK 25.2 All View Local Help Center View Online Help Center Version: