wPositionY Property (iOS Controls)

Applies to TestComplete 15.63, last modified on April 23, 2024
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

A control's two-dimensional logical position is specified by horizontal and vertical offsets. Use the wPositionY property to get the current vertical position of the control.

Declaration

TestObj.wPositionY

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

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 that specifies the current vertical position of the control.

Remarks

If the control has only horizontal scrolling, the property always returns 0.

Example

JavaScript, JScript

function Test()
{
  // Select the mobile device
  Mobile.SetCurrent("iPhone");
  // Obtain the ScrollView object
  var p = Mobile.Device().Process("SampleApp");
  var scrollview = p.Window().ScrollView();
  
  Log.Message(scrollview.wPositionX);
  Log.Message(scrollview.wPositionY);
}

Python

def Test():
  # Select the mobile device
  Mobile.SetCurrent("iPhone")
  # Obtain the ScrollView object 
  p = Mobile.Device().Process("SampleApp")
  scrollview = p.Window().ScrollView()
  
  Log.Message(scrollview.wPositionX)
  Log.Message(scrollview.wPositionY)

VBScript

Sub Test()
  Dim p, scrollview
  ' Select the mobile device
  Mobile.SetCurrent("iPhone")
  ' Obtain the ScrollView object
  Set p = Mobile.Device.Process("SampleApp")
  Set scrollview = p.Window.scrollview
  
  Log.Message(scrollview.wPositionX)
  Log.Message(scrollview.wPositionY)
End Sub

DelphiScript

procedure Test();
var
  p, scrollview;
begin
  // Select the mobile device
  Mobile.SetCurrent('iPhone');
  // Obtain the ScrollView object
  p := Mobile.Device.Process('SampleApp');
  scrollview := p.Window.ScrollView;
  
  Log.Message(scrollview.wPositionX);
  Log.Message(scrollview.wPositionY);
end;

C++Script, C#Script

function Test()
{
  // Select the mobile device
  Mobile["SetCurrent"]("iPhone");
  // Obtain the ScrollView object
  var p = Mobile["Device"].Process("SampleApp");
  var scrollview = p["Window"]()["ScrollView"]();
  
  Log["Message"](scrollview["wPositionX"]);
  Log["Message"](scrollview["wPositionY"]);
}

See Also

wPositionX Property (iOS Controls)
iOS ScrollView Support
Changing ScrollView Position
Scrolling Table View
Working With Multiline Edit Controls

Highlight search results