Changing Multiline Edit Controls Position

Applies to TestComplete 12.60, last modified on September 17, 2018
Changing the TextView Position

To change the date of a TextView control, assign the required value to the wPositionX and wPositionY properties of the iOS TextView object that TestComplete associates with that control. These properties determine the horizontal and vertical positions of the text view. The following example sets the position of the TextView control to 20 pixels horizontally and 10 pixels vertically:

JavaScript, JScript

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

  // Set TextView position
  textview.wPositionX = 20;
  textview.wPositionY = 10;
}

Python

def Test():
  # Select the mobile device
  Mobile.SetCurrent("iPhone")
  # Obtain the TextView object 
  p = Mobile.Device().Process("SampleApp")
  textview = p.Window().TextView() 

  # Set TextView position
  textview.wPositionX = 20
  textview.wPositionY = 10

VBScript

Sub Test()
  Dim p, textview
  ' Select the mobile device
  Mobile.SetCurrent("iPhone")
  ' Obtain the TextView object
  Set p = Mobile.Device.Process("SampleApp")
  Set textview = p.Window.TextView

  ' Set TextView position
  TextView.wPositionX = 20
  Scrollview.wPositionY = 10
End Sub

DelphiScript

procedure Test();
var
  p, textview;
begin
  // Select the mobile device
  Mobile.SetCurrent('iPhone');
  // Obtain the TextView object
  p := Mobile.Device.Process('SampleApp');
  textview := p.Window.TextView;

  // Set TextView position
  textview.wPositionX := 20;
  textview.wPositionY := 10;
end;

C++Script, C#Script

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

  // Set TextView position
  textview["wPositionX"] = 20;
  textview["wPositionY"] = 10;
}

Setting Position From Keyword Tests

To set the current text view position from keyword tests, call the methods described above by using the On-Screen Action or Call Object Method operation. See Calling Object Methods.

See Also

Working With iOS Text Edit Controls
Checking Multiline Edit Controls Position Range
wPositionX Property (iOS Controls)
wPositionY Property (iOS Controls)

Highlight search results