wPage Property (iOS Controls)

Applies to TestComplete 15.44, last modified on November 10, 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

Specifies the index of the page currently selected in the control.

Declaration

TestObj.wPage

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

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

Property Value

A zero-based index of the page currently selected in the control.

Remarks

If the paging mode of the control is disabled, the property returns -1.

Example

The example below opens the second page in the scroll view.

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();
  
  scrollview.wPage = 1;
}

Python

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

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
  
  scrollview.wPage = 1
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;
  
  scrollview.wPage := 1;
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"]();
  
  scrollview["wPage"] = 1;
}

See Also

Working with ScrollView in Paging Mode
Testing iOS Applications (Legacy)
Working with Table View in Paging Mode
Working with Multiline Edit Controls in Paging Mode

Highlight search results