wDate Property (Mobile Controls)

Applies to TestComplete 15.69, last modified on November 13, 2024
This property is available in legacy mobile tests that work with devices connected to the local computer. To learn how to simulate user actions in newer cloud-compatible mobile tests, see the Simulating user actions in tests section.

Description

Specifies the date that is currently selected in the control.

Declaration

TestObj.wDate

Read-Write Property Date/Time
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Property Value

The date that is currently selected in the control.

Remarks

  • The date format depends on the local setting of the machine performing the test, not the mobile device.

  • iOS DatePicker may also include a time value.

Example

The following example demonstrates how to obtain the date of the Android device using the wDate, wMinDate and wMaxDate properties:

JavaScript, JScript

function Test()
{
  // Select an Android device
  Mobile.SetCurrent("MyDevice");

  // Obtain the CalendarView object
  var p = Mobile.Device().Process("com.example.myapp");
  var CalendarView = p.RootLayout("").Layout("layoutTop").Layout("layout2").CalendarView("calendarView1");
  
  // Get the possible date values
  var CalendarDate = CalendarView.wDate;
  var CalendarMinDate = CalendarView.wMinDate;
  var CalendarMaxDate = CalendarView.wMaxDate;
  
  // Post dates to the log
  Log.Message(CalendarDate);
  Log.Message(CalendarMinDate);
  Log.Message(CalendarMaxDate);
}

Python

def Test():
  # Select an Android device
  Mobile.SetCurrent("MyDevice")

  # Obtain the CalendarView object
  p = Mobile.Device().Process("com.example.myapp")
  CalendarView = p.RootLayout("").Layout("layoutTop").Layout("layout2").CalendarView("calendarView1") 
  
  # Get the possible date values
  CalendarDate = CalendarView.wDate
  CalendarMinDate = CalendarView.wMinDate
  CalendarMaxDate = CalendarView.wMaxDate
  
  # Post dates to the log
  Log.Message(CalendarDate)
  Log.Message(CalendarMinDate)
  Log.Message(CalendarMaxDate)

VBScript

Sub Test()
  ' Select an Android device
  Call Mobile.SetCurrent("MyDevice")

  ' Obtain the CalendarView object
  Set p = Mobile.Device.Process("com.example.myapp")
  Set CalendarView = p.RootLayout("").Layout("layoutTop").Layout("layout2").CalendarView("calendarView1")
  
  ' Get the possible date values
  CalendarDate = CalendarView.wDate
  CalendarMinDate = CalendarView.wMinDate
  CalendarMaxDate = CalendarView.wMaxDate
  
  ' Post dates to the log
  Log.Message(CalendarDate)
  Log.Message(CalendarMinDate)
  Log.Message(CalendarMaxDate)
End Sub

DelphiScript

procedure Test();
var
  p, CalendarView, CalendarMinDate, CalendarMaxDate, CalendarDate : OleVariant;
begin
  // Select an Android device
  Mobile.SetCurrent('MyDevice');

  // Obtain the CalendarView object
  p := Mobile.Device.Process('com.example.myapp');
  CalendarView := p.RootLayout('').Layout('layoutTop').Layout('layout2').CalendarView('calendarView1');
  
  // Get the possible date values
  CalendarDate := CalendarView.wDate;
  CalendarMinDate := CalendarView.wMinDate;
  CalendarMaxDate := CalendarView.wMaxDate;
  
  // Post dates to the log
  Log.Message(CalendarDate);
  Log.Message(CalendarMinDate);
  Log.Message(CalendarMaxDate);
end;

C++Script, C#Script

function Test()
{
  // Select an Android device
  Mobile["SetCurrent"]("MyDevice");

  // Obtain the CalendarView object
  var p = Mobile["Device"]["Process"]("com.example.myapp");
  var CalendarView = p["RootLayout"]("")["Layout"]("layoutTop")["Layout"]("layout2")["CalendarView"]("calendarView1");
  
  // Get the possible date values
  var CalendarDate = CalendarView["wDate"];
  var CalendarMinDate = CalendarView["wMinDate"];
  var CalendarMaxDate = CalendarView["wMaxDate"];
  
  // Post dates to the log
  Log["Message"](CalendarDate);
  Log["Message"](CalendarMinDate);
  Log["Message"](CalendarMaxDate);
}

See Also

Android CalendarView Support
iOS DatePicker Support
Determining DatePicker Date
Touch Action (Mobile Objects)

Highlight search results