wTime Property (Xamarin.Forms Controls)

Applies to TestComplete 14.80, last modified on April 20, 2021

Description

Returns the time currently selected in the control.

Declaration

TestObj.wTime

Read-Only 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 object:

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

A string holding the current time.

Remarks

The time format depends on the local setting of the machine performing a test, not the android device.

Example

The following example demonstrates how to obtain time using the wTime property:

JavaScript, JScript

function Test()
{
  // Select the mobile device
  Mobile.SetCurrent("MyMobileDevice");

  // Obtain the Time Picker object
  var p = Mobile.Device().Process("SampleApp")
  var timepicker = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("TimePicker");
  
  // Get the current time
  var time = timepicker.wTime;
  
  // Post time to the log
  Log.Message(time);
}

Python

def Test():
  # Select the mobile device
  Mobile.SetCurrent("MyMobileDevice")

  # Obtain the Time Picker object
  p = Mobile.Device().Process("SampleApp")
  timepicker = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("TimePicker")
  
  # Get the current time
  time = timepicker.wTime
  
  # Post time to the log
  Log.Message(time)

VBScript

Sub Test()
  Dim time

  ' Select the mobile device
  Mobile.SetCurrent("MyMobileDevice")

  ' Obtain the Time Picker object
  Set p = Mobile.Device.Process("SampleApp")
  Set timepicker = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("TimePicker")

  ' Get the current time
  time = timepicker.wTime
  
  ' Post time to the log
  Log.Message(time)
End Sub

DelphiScript

procedure Test();
var
  p, timepicker, time;
begin
  // Select the mobile device
  Mobile.SetCurrent('MyMobileDevice');

  // Obtain the Time Picker object
  p := Mobile.Device.Process('SampleApp');
  timepicker := p.XFObject('MainPage', '').XFObject('Grid', '').XFObject('TimePicker');
  
  // Get the current time
  time := timepicker.wTime;
  
  // Post time to the log
  Log.Message(time);
end;

C++Script, C#Script

function Test()
{
  // Select the mobile device
  Mobile["SetCurrent"]("MyMobileDevice");

  // Obtain the Time Picker object
  var p = Mobile["Device"].Process("SampleApp")
  var timepicker = p["XFObject"]("MainPage", "")["XFObject"]("Grid", "")["XFObject"]("TimePicker");
  
  // Get the current time
  var time = timepicker["wTime"];
  
  // Post time to the log
  Log["Message"](time);
}

See Also

List of Xamarin.Forms Controls
Testing Xamarin.Forms Applications (Legacy)

Highlight search results