wValue Property (Android NumberPicker Object)

Applies to TestComplete 14.30, last modified on November 21, 2019

Description

Use the wValue property to set or get the current value of the control. This value must be within the range wMin...wMax (the bounds are included).

Declaration

TestObj.wValue

Read-Write Property Integer
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

An integer value specifying the current position of the slider.

Remarks

  • If you assign a value to wValue and this value is greater than wMax (or less than wMin), it will be automatically replaced with the wMax (or wMin) value, and an error message will be posted to the log.

Example

The following example obtains the wValue property and posts it to the log:

JavaScript, JScript

function Test()
{
  // Select the Android device
  Mobile.SetCurrent("MyDevice");
  
  // Obtain the SeekBar object
  var p = Mobile.Device().Process("com.example.myapp");
  var NumberPicker = p.RootLayout("").Layout("layoutTop").Layout("layout2").NumberPicker("numberpicker1");
  
  // Get the NumberPicker position
  var Position = NumberPicker.wValue;
  
  // Post the position to the log
  Log.Message(Position);
}

Python

def Test():
  # Select the Android device
  Mobile.SetCurrent("MyDevice")
  
  # Obtain the SeekBar object
  p = Mobile.Device().Process("com.example.myapp")
  NumberPicker = p.RootLayout("").Layout("layoutTop").Layout("layout2").NumberPicker("numberpicker1")
  
  # Get the NumberPicker position
  Position = NumberPicker.wValue
  
  # Post the position to the log
  Log.Message(Position)

VBScript

Sub Test()
  Dim p, SeekBar, Position

  ' Select the Android device
  Mobile.SetCurrent("MyDevice")
  
  ' Obtain the NumberPicker object
  Set p = Mobile.Device.Process("com.example.myapp")
  Set NumberPicker = p.RootLayout("").Layout("layoutTop").Layout("layout2").NumberPicker("numberpicker1")
  
  ' Get the NumberPicker position
  Position = NumberPicker.wValue
  
  ' Post the position to the log
  Log.Message(Position)
End Sub

DelphiScript

procedure Test();
var 
  p, NumberPicker, Position;
begin
  // Select the Android device
  Mobile.SetCurrent('MyDevice');
  
  // Obtain the SeekBar object
  p := Mobile.Device.Process('com.example.myapp');
  NumberPicker := p.RootLayout('').Layout('layoutTop').Layout('layout2').NumberPicker('numberpicker1');
  
  // Get the SeekBar position
  Position := SeekBar.wValue;
  
  // Post the position to the log
  Log.Message(Position);
end;

C++Script, C#Script

function Test()
{
  // Select the Android device
  Mobile["SetCurrent"]("MyDevice");
  
  // Obtain the SeekBar object
  var p = Mobile["Device"]["Process"]("com.example.myapp");
  var NumberPicker = p["RootLayout"]("")["Layout"]("layoutTop")["Layout"]("layout2")["NumberPicker"]("numberpicker1");
  
  // Get the NumberPicker position
  var Position = NumberPicker["wValue"];
  
  // Post the position to the log
  Log["Message"](Position);
}

See Also

About Testing Android Applications
Determining the Number Picker Value
wMax Property (Android Controls)
wMin Property (Android Controls)

Highlight search results