Cloud SMS (FR)

Perfecto Command

mobile:gateway:sms

Purpose

Sends an SMS message to the selected destination. It is possible to select multiple destinations that may include devices, users, and phones.

There is no default. To use this command, at least one destination must be selected.

When specifying a device via the to.handset parameter, verify that the device has a SIM card, which is required for sending SMS.

When specifying a number via the to.number parameter, replace the '+' character with %2B in the sent string.

Parameters

Name Type Possible Values Description
body String

The message text for this command.

default body - "Test from Perfecto Mobile"

to.handset Handset Device ID The destination device. It is possible to select multiple devices (separated by commas).
to.user String

The destination user. It is possible to select multiple users.

The user identifier is the Perfecto username.

The user must be registered with the correct mobile number.

The business number field does not apply.

to.logical String user | none The user currently running the script.
to.number String

The destination phone number. It is possible to select multiple phone numbers.

Format -  +[country code][area code][phone number]

Example -  +17812054111

Return Value

None

Exceptions

Unrecognized parameter -

Examples

Copy

Java sample

Map<String, Object> pars = new HashMap<>();
pars.put("to.number", "+972541234567");
pars.put("body", "come to party at 1900");
String reStr = (String) driver.executeScript("mobile:gateway:sms", pars);
Copy

Java sample with multiple numbers

Map<String, Object> pars = new HashMap<>();
pars.put("body", "Enter Text Message Here");
List<String> numbers = new ArrayList<>();
numbers.add("+359111111111");
numbers.add("+111111111111");
pars.put("to.number", numbers);
String reStr = (String) driver.executeScript("mobile:gateway:sms", pars);
Copy

C# sample

Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.Add("to.number", "+972541234567");
pars.Add("body", "come to party at 1900");
String reStr = (String) driver.ExecuteScript("mobile:gateway:sms", pars);