wMax Property (Android Controls)

Applies to TestComplete 15.42, last modified on September 08, 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

The position of the slider can take on values from the defined range. The wMax property returns the maximum value of this range.

Declaration

TestObj.wMax

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

View Mode

To view this property in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.

Property Value

An integer value specifying the maximum position of the slider.

Example

The following example obtains the wMin and wMax values and posts them 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 SeekBar = p.RootLayout("").Layout("layoutTop").Layout("layout2").SeekBar("seekbar1");
  
  // Get the SeekBar minimum and maximum positions
  var MinPosition = SeekBar.wMin;
  var MaxPosition = SeekBar.wMax;
   
  // Post the position to the log
  Log.Message(MinPosition);
  Log.Message(MaxPosition);
}

Python

def Test():
  # Select the Android device
  Mobile.SetCurrent("MyDevice")
  
  # Obtain the SeekBar object
  p = Mobile.Device().Process("com.example.myapp")
  SeekBar = p.RootLayout("").Layout("layoutTop").Layout("layout2").SeekBar("seekbar1")
  
  # Get the SeekBar minimum and maximum positions
  MinPosition = SeekBar.wMin
  MaxPosition = SeekBar.wMax
   
  # Post the position to the log
  Log.Message(MinPosition)
  Log.Message(MaxPosition)

VBScript

Sub Test()
  Dim p, SeekBar, MinPosition, MaxPosition

  ' Select the Android device
  Mobile.SetCurrent("MyDevice")
  
  ' Obtain the SeekBar object
  Set p = Mobile.Device.Process("com.example.myapp")
  Set SeekBar = p.RootLayout("").Layout("layoutTop").Layout("layout2").SeekBar("seekbar1")
  
  ' Get the SeekBar minimum and maximum positions
  MinPosition = SeekBar.wMin
  MaxPosition = SeekBar.wMax
   
  ' Post the position to the log
  Log.Message(MinPosition)
  Log.Message(MaxPosition)
End Sub

DelphiScript

procedure Test();
var 
  p, SeekBar, MaxPosition, MinPosition;
begin
  // Select the Android device
  Mobile.SetCurrent('MyDevice');
  
  // Obtain the SeekBar object
  p := Mobile.Device.Process('com.example.myapp');
  SeekBar := p.RootLayout('').Layout('layoutTop').Layout('layout2').SeekBar('seekbar1');
  
  // Get the SeekBar minimum and maximum positions
  MinPosition := SeekBar.wMin;
  MaxPosition := SeekBar.wMax;
   
  // Post the position to the log
  Log.Message(MinPosition);
  Log.Message(MaxPosition);
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 SeekBar = p["RootLayout"]("")["Layout"]("layoutTop")["Layout"]("layout2")["SeekBar"]("seekbar1");
  
  // Get the SeekBar minimum and maximum positions
  var MinPosition = SeekBar["wMin"];
  var MaxPosition = SeekBar["wMax"];
   
  // Post the position to the log
  Log["Message"](MinPosition);
  Log["Message"](MaxPosition);
}

See Also

About Testing Android Applications (Legacy)
Determining Minimum and Maximum Number Picker Values
Determining the Seek Bar Position
Determining the Minimum and Maximum Scroll Vew Positions
wMin Property (Android Controls)
wPosition Property (Android Controls)

Highlight search results