Determining the Current Value of a Stepper Control

Applies to TestComplete 14.71, last modified on April 22, 2021
Getting the wPosition Property

To determine the value of a stepper control, use the wPosition property. This property returns the current value of the stepper control. The following example demonstrates how to obtain a stepper control's value:

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);
   
  Log.Message(stepper.wPosition)
}

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)
   
  Log.Message(stepper.wPosition)

VBScript

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

DelphiScript

procedure Test();
var
  p, stepper;
begin
  // Select the mobile device
  Mobile.SetCurrent('iPhone');
  // Obtain the stepper object
  p := Mobile.Device.Process('SampleApp');
  stepper := p.Window(0).Stepper(1);
   
  Log.Message(stepper.wPosition);
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);
   
  Log["Message"](stepper["wPosition"])
}

Determining the Value of a Stepper Control in Keyword Tests

To determine the stepper value 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 Minimum and Maximum Stepper Values

Highlight search results