SMS Method

Applies to TestComplete 15.47, last modified on January 20, 2023
The information below concerns legacy mobile tests that work with mobile devices connected to the local computer. For new mobile tests, we recommend using the newer cloud-compatible approach.

Description

Sends an SMS message to the specified phone number.

Declaration

AndroidDeviceObj.SMS(PhoneNumber, Message)

AndroidDeviceObj An expression, variable or parameter that specifies a reference to an AndroidDevice object
PhoneNumber [in]    Required    String    
Message [in]    Required    String    
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

PhoneNumber

Specifies the phone number to send the message to.

Message

Specifies the text to be sent.

Result Value

None.

Remarks

This method is asynchronous. This means that TestComplete continues running the test, no matter whether it has finished or not. For information on how it may affect testing on Android devices, see Possible Issues.

Example

The following code demonstrated how you can send an SMS to the specified number:

JavaScript, JScript

Mobile.Device("MyDevice").SMS("3222322", "Hi there!");

Python

Mobile.Device("MyDevice").SMS("3222322", "Hi there!")

VBScript

Call Mobile.Device("MyDevice").SMS("3222322", "Hi there!")

DelphiScript

Mobile.Device('MyDevice').SMS('3222322', 'Hi there!');

C++Script, C#Script

Mobile["Device"]("MyDevice")["SMS"]("3222322", "Hi there!");

See Also

Testing Android Applications (Legacy)
Call Method
AndroidDevice Object

Highlight search results