Determining the Minimum and Maximum Stepper Values

Applies to TestComplete 15.47, last modified on January 20, 2023
Getting the wMin and wMax Properties

To determine the minimum and maximum values of a stepper control, use the wMin and wMax properties. These properties define the possible minimum and maximum values of the stepper control. The following example obtains the wMin and wMax properties and posts them to the log:

JavaScript, JScript

function Test()
{
  // Select the mobile device
  Mobile.SetCurrent("iPhone");
  // Obtain the stepper object
  var p = Mobile.Device().Process("SampleApp");
  var stepper = p.Window(0).Stepper(1);

  // Get the minimum and maximum values
  var MinPos = stepper.wMin;
  var MaxPos = stepper.wMax;

  // Post the values to the log
  Log.Message(MinPos);
  Log.Message(MaxPos);
}

Python

def Test():
  # Select the mobile device
  Mobile.SetCurrent("iPhone")
  # Obtain the stepper object
  p = Mobile.Device().Process("SampleApp")
  stepper = p.Window(0).Stepper(1)

  # Get the minimum and maximum values
  MinPos = stepper.wMin
  MaxPos = stepper.wMax

  # Post the values to the log
  Log.Message(MinPos)
  Log.Message(MaxPos)

VBScript

Sub Test()
  Dim p, stepper, MinPos, MaxPos
  ' Select the mobile device
  Mobile.SetCurrent("iPhone")
  ' Obtain the stepper object
  Set p = Mobile.Device.Process("SampleApp")
  Set stepper = p.Window(0).Stepper(1)

  ' Get the minimum and maximum values
  MinPos = stepper.wMin
  MaxPos = stepper.wMax

  ' Post the values to the log
  Log.Message(MinPos)
  Log.Message(MaxPos)
End Sub

DelphiScript

procedure Test();
var
  p, stepper, MinPos, MaxPos;
begin
  // Select the mobile device
  Mobile.SetCurrent('iPhone');
  // Obtain the stepper object
  p := Mobile.Device.Process('SampleApp');
  stepper := p.Window(0).Stepper(1);

  // Get the minimum and maximum values
  MinPos := stepper.wMin;
  MaxPos := stepper.wMax;

  // Post the values to the log
  Log.Message(MinPos);
  Log.Message(MaxPos);
end;

C++Script, C#Script

function Test()
{
  // Select the mobile device
  Mobile["SetCurrent"]("iPhone");
  // Obtain the stepper object
  var p = Mobile["Device"].Process("SampleApp");
  var stepper = p["Window"](0)["Stepper"](1);

  // Get the minimum and maximum values
  var MinPos = stepper["wMin"];
  var MaxPos = stepper["wMax"];

  // Post the values to the log
  Log["Message"](MinPos);
  Log["Message"](MaxPos);
}

Determining a Stepper Control's Min and Max Values in Keyword Tests

To check the minimum and maximum stepper values from keyword tests, use the On-Screen Action or Call Object Method operation to access the properties described above. See Getting and Setting Object Property Values.

See Also

Working With iOS Stepper Controls
Determining the Current Value of a Stepper Control

Highlight search results