Checking Multiline Edit Controls Position Range

Applies to TestComplete 15.47, last modified on January 20, 2023
Getting wMaxDate and wMinDate Properties

To determine the minimum and maximum position of a text view control, use the following properties of the iOS TextView object:

  • wMaxX– returns the maximum horizontal position of the text view.
  • wMaxY– returns the maximum vertical position of the text view.
  • wMinX– returns the minimum horizontal position of the text view.
  • wMinX– returns the minimum vertical position of the text view.

The following example determines the minimum and maximum dates of the TextView and posts them to the log:

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();

  // Post TextView minimum and maximum positions to the log
  Log.Message(textview.wMaxX);
  Log.Message(textview.wMaxY);
  Log.Message(textview.wMinX);
  Log.Message(textview.wMinY);
}

Python

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

  # Post TextView minimum and maximum positions to the log
  Log.Message(textview.wMaxX)
  Log.Message(textview.wMaxY)
  Log.Message(textview.wMinX)
  Log.Message(textview.wMinY)

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

  ' Post TextView minimum and maximum positions to the log
  Log.Message(textview.wMaxX)
  Log.Message(textview.wMaxY)
  Log.Message(textview.wMinX)
  Log.Message(textview.wMinY)
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;

  // Post TextView minimum and maximum positions to the log
  Log.Message(textview.wMaxX);
  Log.Message(textview.wMaxY);
  Log.Message(textview.wMinX);
  Log.Message(textview.wMinY);
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"]();

  // Post TextView minimum and maximum positions to the log
  Log["Message"](textview["wMaxX"]);
  Log["Message"](textview["wMaxY"]);
  Log["Message"](textview["wMinX"]);
  Log["Message"](textview["wMinY"]);
}

Checking Position Range From Keyword Tests

To get the mimimum and maximum positions of a text view 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
Changing Multiline Edit Controls Position
wMaxX Property (iOS Controls)
wMaxY Property (iOS Controls)
wMinX Property (iOS Controls)
wMinY Property (iOS Controls)

Highlight search results