Skip to content
QiTASC.com / Steps and Compound Steps /
Interactive Phone Steps
/ .. /
Interactive Phone Steps





Interactive Phone Steps

These Steps execute actions performed on the phone itself as opposed to Steps that involve call flows (such as dialing, sending an SMS or downloading data). Certain Steps may be timed or deferred

Interactive Phone Steps
Switching the Loudspeaker On/Off
Setting the Preferred Network Type
Enabling/Disabling Airplane Mode
Muting and Unmuting the Microphone
Rebooting Phone and Waiting for it to Become Available
DTMF Steps
Configuring USSD
Sending a USSD
Receiving a USSD Response
Responding to a USSD
Canceling a USSD Dialog
Using a Data Extractor for USSD
Replacing Built-in Steps with Custom Steps

Switching the Loudspeaker On/Off

The loudspeaker must be switched on before beginning a recording in test cases that capture audio recordings. Loudspeakers can only be activated while a call is connected, connecting or ringing.

Switching the Loudspeaker On

Syntax

1
<name Identifier> switches loudspeaker on

Parameter

  • name - The name assigned to the phone switching the loudspeaker on

Example

1
And A switches loudspeaker on

Switching the Loudspeaker Off

Syntax

1
<name Identifier> switches loudspeaker off

Parameter

  • name - The name assigned to the phone switching the loudspeaker off

Example

1
And A switches loudspeaker off

These Steps are eligible for:

  • Timed

Setting the Preferred Network Type

There are a few options concerning the network type:

Syntax

1
<name Identifier> sets its preferred network type to <networkType String>

Parameters

  • name - The name assigned to the phone setting the preferred network type

  • networkType - May be one of "2G", "2G ONLY", "3G", "3G ONLY", "4G" or "4G ONLY"

    • When a network type declaration includes ONLY, the Step will fail if the phone is unsuccessful at registering with the specified network type

Example

1
And B sets its preferred network type to "4G"

This Step is eligible for:

  • Timed

  • Deferred

Enabling/Disabling Airplane Mode

Enabling Airplane Mode

Syntax

1
<name Identifier> enables airplane mode

Parameter

  • name - The name assigned to the phone enabling airplane mode

Example

1
And A enables airplane mode

Disabling Airplane Mode

Syntax

1
<name Identifier> disables airplane mode

Parameter

  • name - The name assigned to the phone disabling airplane mode

Example

1
And A disables airplane mode

These Steps are eligible for:

  • Timed

  • Deferred

Muting and Unmuting the Microphone

This Step mutes and unmutes the microphone. It can only be executed if the phone is connected in a call, but not in advance of a phone call. If the mutes Step is executed in a call, the microphone will automatically be unmuted for the next call.

Note: The muting/unmuting Steps only work with Android phones.

Syntax

1
<name Identifier> mutes its microphone
Parameter

  • name - The name assigned to the phone muting its microphone

Example

1
And A mutes its microphone

This Step is eligible for:

  • Timed

The microphone can be unmuted with the following Step:

Syntax

1
<name Identifier> unmutes its microphone

Parameter

  • name - The name assigned to the phone unmuting its microphone

Example

1
And A unmutes its microphone

This Step is eligible for:

  • Timed

Rebooting Phone and Waiting for it to Become Available

Two reboot Steps are available for locally connected phones: The first reboots the phone and the second waits for the reboot to the complete.

While the reboot is in process, Steps involving other devices can still be executed. However, accessing phone properties or calling any Steps that require interaction with the rebooting phone will not work between the two reboot Steps: They will only work after the reboot completes Step successfully finishes.

Syntax

1
2
3
Then <phone Name> reboots
...
Then within <timeout Number> seconds, <phone Name>'s reboot completes

Parameters

  • name - The name assigned to the phone being rebooted

  • timeout - The number of seconds the phone waits for

Example

1
2
3
4
Given an Android phone as A
Then A reboots
...
Then within 60 seconds, A's reboot completes

DTMF Steps

These Steps set DTMF tones. For example, for navigating through an automated voice menu.

Syntax

1
<name Identifier> sends <tone String> as dtmf

Parameters

  • name - The name assigned to the phone setting its DTMF tone

  • tone - The key representing the corresponding tone

    • This can also be a context variable, such as a Context Object or Subscriber Property

Example

1
2
3
And A sends "1" as dtmf
And after 5 seconds, A sends fcLanguage as dtmf
And A sends B.mbPin as dtmf

This Step is eligible for:

  • Timed

Example Test Case: Using a DTMF Menu with an Audio Recording

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Feature: DTMF
  Scenario: DTMFVoucherRecharging
    Given an Android phone as A
      And A disables data connections
      And A sends the following ussd "*100#"
      And within 20 seconds, A receives an ussd response as RESP1
      And extract data1 with ussdFirstAccEnq from RESP1.text
    Given a Voucher consumable as voucher where value == "2"
    When A dials the number "123456"
      Then an audio recording is started
      And within 10 seconds, A connects
      And A switches loudspeaker on
      And after 35 seconds, A sends "1" as dtmf
      And after 15 seconds, A sends "3" as dtmf
      And after 7 seconds, A sends voucher.number + hash as dtmf
      And after 10 seconds, A ends the call
      Then an audio recording is stopped
      And within 15 seconds, A disconnects
      And within 30 seconds, A receives an ussd response as successfulRecharge
    Then verify successfulRecharge.text == "Betrag erfolgreich aufgebucht."
      And A sends the following ussd "*100#"
      And within 20 seconds, A receives an ussd response as RESP2
      And extract data2 with ussdFirstAccEnq from RESP2.text
    Then verify data1.bal + 2 == data2.bal

USSD

USSD commands can be used to send/receive certain information or change settings. For example, to check a subscriber's balance by sending an account enquiry. The available USSD codes depend on the phone, the network operator and whether it is a prepaid phone or not.

USSD Configuration

These codes can be configured as Context Objects in a .conf file.

Syntax

1
2
3
4
5
ContextObjects {
    ...
    <name Identifier> = <ussdCode String>
    ...
}

Parameters

  • name - The name assigned to the USSD code

  • ussdCode - The USSD code

Example

1
2
3
4
5
6
ContextObjects {
    ...
    ussdAccEnq = "*106#"
    LastTransactionCost = "*102#"
    ...
}

Sending a USSD Code

Syntax

1
<name Identifier> sends the following ussd <ussdCode String>

Parameters

  • name - The name assigned to the USSD code

  • ussdCode - The USSD code

Example

1
And A sends the following ussd ussdAccEnq

This Step is eligible for:

  • Timed

  • Deferred

Receiving a USSD Response

This Step checks if a response to the USSD code has arrived. It then saves the response as a variable.

Syntax

1
within <time Number> seconds, <name Identifier> receives an ussd response as <ussdName Identifier>

Parameters

  • time - A number referring to the amount of time in seconds

  • name - The name assigned to the phone receiving the USSD response

  • ussdName - The name assigned to the USSD response

Example

1
And within 30 seconds, A receives an ussd response as RESP1

This Step is eligible for

  • Deferred

Responding to a USSD

This Step creates a response to a received USSD code. For example, if the USSD code sent has accessed a menu. Use the following Step to navigate through the menu.

Syntax

1
<name Identifier> responds to interactive ussd with <response String>

Parameters

  • name - The name assigned to the phone responding to the USSD

  • response - The response sent by the phone

    • This string will always be numeric

Confirming the correct response to a USSD may require manually navigating through a menu.

Example

1
And A responds to interactive ussd with "2"

This Step is eligible for:

  • Timed

  • Deferred

Canceling a USSD Dialog

This Step is used to exit a USSD menu.

Syntax

1
<name Identifier> cancels interactive ussd dialog

Parameter

  • name - The name assigned to the phone canceling the USSD dialog

Example

1
And A cancels interactive ussd dialog

This Step is eligible for:

  • Timed

  • Deferred

Using a Data Extractor for USSD

intaQt's Extractor can be used to filter or extract data from a USSD response.

Syntax

1
extract <variable1 String> with <extractor Identifier> from <variable2 String>

Parameters

  • variable1 - The variable that stores the data from variable2

  • extractor - The name assigned to the extractor

  • variable2 - The content of the USSD response

Example

1
And extract data1 with ussdFirstAccEnq from RESP1.text

In the example above, data1 holds the amount received after the extraction from RESP1.

Test Case Example: Sending and Receiving USSD

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
Feature: USSD
  Scenario Outline: USSD
    Given an Android phone as A
      And an Android phone as B
      And A sends the following ussd "*100#"
      And within 20 seconds, A receives an ussd response as RESP1
      And extract data1 with ussdFirstAccEnq from RESP1.text
    When A dials the number B.number
      And within 50 seconds, B detects an incoming call from A.number
      And after 2 seconds, B answers the incoming call
      And within 5 seconds, A connects
      And after <dur> seconds, A ends the call and, within 10 seconds,
      he and B disconnect
      And A sends the following ussd "*100#"
      And within 20 seconds, A receives an ussd response as RESP2
      And extract data2 with ussdFirstAccEnq from RESP2.text
    Then the charge for <charge>(<dur>) is (data1.bal - data2.bal)
  Examples:
    | dur | charge        |
    | 5   | VoiceCharge   |
    | 10  | VoiceNational |