wTime Property (Android Controls)

Applies to TestComplete 15.45, last modified on December 01, 2022
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

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 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

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 Android device
  Mobile.SetCurrent("VirtualBox");

  // Obtain the clock object
  var p = Mobile.Device().Process("tctests.textclock_api17")
  var TextClock = p.RootLayout("").Layout("layoutTop").Layout("layout1").TextClock("textClock1");
  
  // Get the clock time
  var Time = TextClock.wTime;
  
  // Post time to the log
  Log.Message(Time);
}

Python

def Test():
  # Select the Android device
  Mobile.SetCurrent("VirtualBox")

  # Obtain the clock object
  p = Mobile.Device().Process("tctests.textclock_api17")
  TextClock = p.RootLayout("").Layout("layoutTop").Layout("layout1").TextClock("textClock1") 
  
  # Get the clock time
  Time = TextClock.wTime
  
  # Post time to the log
  Log.Message(Time)

VBScript

Sub Test()
  Dim Time

  ' Select the Android device
  Mobile.SetCurrent("VirtualBox")

  ' Obtain the clock object
  Set p = Mobile.Device.Process("tctests.textclock_api17")
  Set TextClock = p.RootLayout("").Layout("layoutTop").Layout("layout1").TextClock("textClock1")

  ' Get the clock time
  Time = TextClock.wTime
  
  ' Post time to the log
  Log.Message(Time)
End Sub

DelphiScript

procedure Test();
var
  p, TextClock, Time;
begin
  // Select the Android device
  Mobile.SetCurrent('VirtualBox');

  // Obtain the clock object
  p := Mobile.Device.Process('tctests.textclock_api17');
  TextClock := p.RootLayout('').Layout('layoutTop').Layout('layout1').TextClock('textClock1');
  
  // Get the clock time
  Time := TextClock.wTime;
  
  // Post time to the log
  Log.Message(Time);
end;

C++Script, C#Script

function Test()
{
  // Select the Android device
  Mobile["SetCurrent"]("VirtualBox");

  // Obtain the clock object
  var p = Mobile["Device"].Process("tctests.textclock_api17")
  var TextClock = p["RootLayout"]("")["Layout"]("layoutTop")["Layout"]("layout1")["TextClock"]("textClock1");
  
  // Get the clock time
  var Time = TextClock["wTime"];
  
  // Post time to the log
  Log["Message"](Time);
}

See Also

About Testing Android Applications (Legacy)
Getting Clock Control's Time
Determining and Changing Time Using Time Picker Control
Touch Action (Mobile Objects)

Highlight search results