wMessage Property (Specific to iOS AlertView Object)

Applies to TestComplete 15.47, last modified on January 20, 2023
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

Use the wMessage property to get the caption of the alert view message.

Declaration

TestObj.wMessage

Read-Only Property String
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

The message of an alert view.

Example

The following example obtains the message of the alert view and posts it to the log.

JavaScript, JScript

function Test()
{
  // Select the mobile device
  Mobile.SetCurrent("iPhone");
  // Obtain the AlertView object
  var p = Mobile.Device().Process("SampleApp");
  var alertview = p.Window(2).AlertView("Alert title");
  
  Log.Message(alertview.wMessage);
}

Python

def Test():
  # Select the mobile device
  Mobile.SetCurrent("iPhone")
  # Obtain the AlertView object 
  p = Mobile.Device().Process("SampleApp")
  alertview = p.Window(2).AlertView("Alert title")
  
  Log.Message(alertview.wMessage)

VBScript

Sub Test()
  Dim p, AView
  ' Select the mobile device
  Mobile.SetCurrent("iPhone")
  ' Obtain the tableview object
  Set p = Mobile.Device.Process("SampleApp")
  Set AView = p.Window(2).AlertView("Alert title")
  
  Log.Message(AView.wMessage)
End Sub

DelphiScript

procedure Test();
var
  p, alertview;
begin
  // Select the mobile device
  Mobile.SetCurrent('iPhone');
  // Obtain the AlertView object
  p := Mobile.Device.Process('SampleApp');
  alertview := p.Window(2).AlertView('Alert title');
  
  Log.Message(alertview.wMessage);
end;

C++Script, C#Script

function Test()
{
  // Select the mobile device
  Mobile["SetCurrent"]("iPhone");
  // Obtain the AlertView object
  var p = Mobile["Device"].Process("SampleApp");
  var alertview = p["Window"](2)["AlertView"]("Alert title");
  
  Log["Message"](alertview["wMessage"]);
}

See Also

Getting Alert View Title and Message
iOS AlertView Support

Highlight search results