wPosition Property (Specific to Xamarin.Forms Slider Controls)

Applies to TestComplete 15.63, last modified on April 23, 2024

Description

Use the wPosition property to get or set the current logical position of the slider. This value must be within the range wMinwMax (the bounds are included).

Declaration

TestObj.wPosition

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

A float value specifying the current position of the slider.

Remarks

  • If you assign a value to wPosition and this value is greater than wMax (or less than wMin), it will be automatically replaced with the wMax (or wMin) value.

Example

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

JavaScript, JScript

function Test()
{

  // Select the mobile device
  Mobile.SetCurrent("MyMobileDevice");

  // Obtain the slider object
  var p = Mobile.Device().Process("SampleApp");
  var slider = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("Slider", "");

  // Get the slider position
  var pos = slider.wPosition;

  // Post the position to the log
  Log.Message(pos);

}

Python

def Test():

  # Select the mobile device
  Mobile.SetCurrent("MyMobileDevice")

  # Obtain the slider object
  p = Mobile.Device().Process("SampleApp")
  slider = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("Slider", "")

  # Get the slider position
  pos = slider.wPosition

  # Post the position to the log
  Log.Message(pos)

VBScript

Sub Test

  ' Select the mobile device
  Mobile.SetCurrent("MyMobileDevice")

  ' Obtain the slider object
  Set p = Mobile.Device.Process("SampleApp")
  Set slider = p.XFObject("MainPage", "").XFObject("Grid", "").XFObject("Slider", "")

  ' Get the slider position
  pos = slider.wPosition

  ' Post the position to the log
  Log.Message pos

End Sub

DelphiScript

procedure Test();
var p, slider, pos;
begin

  // Select the mobile device
  Mobile.SetCurrent('MyMobileDevice');

  // Obtain the slider object
  p := Mobile.Device.Process('SampleApp');
  slider := p.XFObject('MainPage', '').XFObject('Grid', '').XFObject('Slider', '');

  // Get the slider position
  pos := slider.wPosition;

  // Post the position to the log
  Log.Message(pos);

end;

C++Script, C#Script

function Test()
{

  // Select the mobile device
  Mobile["SetCurrent"]("MyMobileDevice");

  // Obtain the slider object
  var p = Mobile["Device"]["Process"]("SampleApp");
  var slider = p["XFObject"]("MainPage", "")["XFObject"]("Grid", "")["XFObject"]("Slider", "");

  // Get the slider position
  var pos = slider["wPosition"];

  // Post the position to the log
  Log["Message"](pos);

}

See Also

wMin Property (Specific to Xamarin.Forms Slider Controls)
wMax Property (Specific to Xamarin.Forms Slider Controls)
Xamarin.Forms Slider Support
Testing Xamarin.Forms Applications (Legacy)

Highlight search results