System Variables

MomentumSuite system variables are useful in some cases. Available system variables are host, device_index, os_version, device, case_id, appUrl, is Error, and more. Check the full list at the bottom of this page.

 

Here are some useful examples.

process.env.SYSTEM_VARIABLE

device_index usage: Different test data usage per device on Test Run. Index starts from 0.

var customerNumberList = ['5309138', '5390172', '5390213', '5393603', '5309393', '5390446']; var currentCustomerNumber = customerNumberList[process.env.device_index];

 

 

System.getenv("SYSTEM_VARIABLE")

device_index usage: Different test data usage per device on Test Run. Index starts from 0.

import java.util.ArrayList; import java.util.List; List<String> customerNumberList = new ArrayList<>(); customerNumberList.add("5309138"); customerNumberList.add("5390172"); customerNumberList.add("5390213"); String currentCustomerNumber = customerNumberList.get(System.getenv("device_index"));

 

 

The full list of system variables:

{"host", GetHost(model.Device.DeviceOs.ToLower(), model.Device.IntegrationId)}, {"device_index",model.Device.Index.ToString()}, {"port", model.Device.SignalPort.ToString()}, {"test_id", model.TestId.ToString()}, {"session_id", model.SessionId}, {"type", GetTestType(model.Device.DeviceOs)}, {"os_version",model.Device.OsVersion}, {"test_plan_id", model.TestId.ToString()}, {"device", model.Device.DeviceToken}, {"assets", _config.Value.AssetsFilePath}, {"device_id", model.Device.Id.ToString()}, {"case_id", model.Case.Id.ToString()}, {"integration_id", model.Device.IntegrationId.ToString()}, {"output", output}, {"appUrl", model.AppUrl}, {"isError",CheckTestStatus.IsError.ToString().ToLower()} os_type

 

SAMPLE DATA

host:https://hub.momentumsuite.com
device_index:0
port:6003
test_id:19704
session_id:5b8f77d6-21d8-40f3-b32c-52d296136d9c
type:mobile
os_version:14.2
test_plan_id:19704
device:00008030-001229260C8B802E
assets:/app/
device_id:5575
case_id:14337
integration_id:
output:/app/wwwroot/build_java/5575_14337
appUrl:
isError:false

os_type:android