Skip to content
QiTASC.com / General Concepts /
Context Variables
/ .. /
Context Variables





Context Variables

Context Variables contain values that are accessible throughout the Scenario execution context. Custom Context Variables may be defined in Feature Files. In addition, intaQt makes the Context Variables of devices and events available to the execution context.

Context Variables
Defining Context Variables in the Execution Context
Accessing Phone Property Context Variables
Addressing Phone Properties Within a Feature File
Static Phone Properties
Subscriber Properties
Dynamic Phone Properties
Phone History
Phone States

Defining Context Variables in the Execution Context

This step defines a Context Variable and assigns it a value. When assigning a number to the value, it will be interpreted as a BigDecimal value.

Syntax

1
define <variable Identifier> as <value Any>

Parameters

  • variable - The variable name

  • value - The value assigned to the variable

Example

1
2
3
4
5
6
define bitRate as soap.maxBitrate
And define format as internationalFormat
And define balance as <credit>
And define myVar as 35
And define expiryDate as "1970-01-01 00:00:00"
And define balanceAfterEvent as (balanceBeforeEvent - callCost)

This step is eligible for:

  • Timed

Accessing Phone Property Context Variables

Context Variables holding phone properties contain values regarding:

  • Properties of the network's phones:

    • Static phone properties
    • Dynamic phone properties
    • Subscriber properties
  • Phone history

  • Phone states

  • Context Objects

  • Scenario objects

When intaQt is running, a list of locally-connected phones' properties is accessible by entering the address 127.0.0.1:<httpPort>/phones into a browser, with 8080 as the default HTTP Port. Phone properties for local and remote phones are also accessible through intaQt Studio in the intaQt Phone Plugin.

Addressing Phone Properties within a Feature File 45

Context Variables may be addressed by prefixing the phone identifier before the variable. In CDR verification, ctx must be used to address Context Variables.

Syntax 1- Context Variable

1
<phone Identifier>.<property Property>

Syntax 2 - Context Variable Accessed in CDR Verification

1
ctx.<phone Identifier>.<property Property|ContextVariable>

Parameters

  • phone - The identifier of the phone whose properties are being accessed

  • property - The phone property

    • This must be a phone property, or a context variable that resolves to a phone property

Built-in phone properties are available below for the following:

Static Phone Properties

Static Phone Properties can not be changed. They originate in the phones or SIM cards accessed by the test case, for example, the telephone number.

Name Description
msisdn, number, local The phone number in different formats.
serialNumber, imei, imsi, type The serialNumber, IMEI, IMSI and type of phone, for example, Android.
version, platform The intaQt version and the Android platform version of the Android.
simMnc, simMcc SIM card MNC and MCC values.

Subscriber Properties

Subscriber Properties refer to properties defined in the Subscribers Configuration regarding specific phone numbers. Subscriber Properties for Remote Phones must also be configured in the intaQt Phone Service.

intaQt imports the Subscribers block with all defined properties and are added to the list. Accessing the Subscriber Properties in a test caserequires a prefixed phone identifier and a . (for example, A.ringTone). In CDR verification, ctx. must be used as the prefix of the subscriber property (such as ctx.A.ringTone).

Dynamic Phone Properties

Dynamic Properties are generated whenever a scenario starts, and may be updated or remain the same until the end of the scenario. For example, the network ID, or signal strength.

Dynamic Phone Properties are also updated whenever they are accessed during a test case. For example, if the test case uses a step to verify the signal strength, for example, verify A.signalStrengthDbm > 91, intaQt fetches the phone's signal strength at the time the step is executed.

Property Description
cellId The network cell ID.
locationAreaCode The network location area code.
network, networkId, networkType The network, network ID and network type.
operator, operatorID, MNC, MCC The network operator and its operator ID, as well as the operator ID's MNC and MCC.
signalStrengthDbm:
  • RSSI
  • RSCP
  • RSRP
The network strength, as well as the following signal strength indicators:
  • RSSI - GSM
  • RSCP - UMTS (3G)
  • RSRP - LTE (4G)
systemLanguage The language the phone is configured to in standardized abbreviation (for example, en/de/fr).
lastTimeAcquired The UTC timestamp showing when the phone was last acquired during a Feature File execution.

The systemLanguage may be accessed with the following shell command:

1
adb shell getprop persist.sys.language

Phone History

Phone History Properties are Dynamic Yroperties concerning events that took place on a phone, such as call durations. For properties using arrays, the element is at array index 0, for example, myArray[0].

Property Description
incomingCalls[] The list of incoming calls, if any, stored in an array for the scenario's duration.
outgoingCalls[] The list of outgoing calls, if any, stored in an array for the scenario's duration.
lastCallConnectTime The CONNECT timestamp of the the event for the most recent call.
lastCallDisconnectTime The DISCONNECT timestamp of the the event for the most recent call.
lastCallDuration The duration of the most recently-ended call.
lastSmsSendTime The timestamp of the the event for the most recent SMS.
sms<Number>SendTime The time the nth SMS of a scenario was sent. Note that this is not addressed like an array, but by using a number, for example, sms1SendTime, addresses the first SMS sent.

Phone History : Incoming and Outgoing Call Properties

The incomingCalls[] and outgoingCalls[] Phone History Properties also have dynamic call properties. These call properties may be concatenated, for example, A.outgoingCalls[0].callDuration. and ctx.A.outgoingCalls[0].callDuration).

Property Description
callDuration The duration that the call was in the connected state.
connectedLineIdentity The number of the other call party , for example, the number dialed or the incoming number (can be unknown for CLIR).
connectTime The time the call connected.
disconnectTime The time the call disconnected.
ringingDuration The duration the call was in the ringing state.
startTime The start of the call.

Phone States

Phone States are Dynamic Phone Properties describing a phone's state during a specified event in a test case, such as when ringing. This state can not be used for any CDR verification.

Property Description
isConnected() Phone is connected.
isConnecting() Phone is connecting.
isRinging() Phone is ringing.