Overview
Cyara Test Cases can be used in a range of different ways to test IVR applications, in this example, we'll walk through how to use a Cyara Test Case to capture a spoken Call Connection ID from your IVR system.
Note: This testing method is best implemented in a staging/demo environment to conduct functional testing before going live. This process is not recommended to be used in a live production environment.
There are 4 stages to this example;
- The Cyara Test Case spoofs a Calling Number so that the testing IVR can identify this call as originating from Cyara.
- Once this spoofed number is recognized, the IVR would then speak out the Connection Id.
- Step 1 of the Test Case captures the spoken Connection ID and echoes the Id to the Detailed Result field using the AlphaNum tag.
- Finally, the Cyara Web API then adds a new ConnectionId property to the Voice Test Results. If the Test Case has a step (1) with an ETH containing {AlphaNum $ConnID} then it would extract the value of the Connection ID from the Detail Result (ConnID=010A02E3D35B4318).
Note: This 4 stage process does rely on two core assumptions with regards to how your existing IVR application functions.
- The IVR must be able to speak a Connection ID to a caller.
- The IVR must have a flow to speak a Connection ID when dialled from a specific number.
See below for a step-by-step guide on how to build the Cyara Test Case that follows the above process, as well as an example API Route that can be used to extract the Connection Id from a successful Test Case execution.
Building the Cyara Test Case.
To build the Test Case to capture the Call Connection ID from your IVR, follow the steps below.
- Login to your Cyara Portal, select Test Cases, and click New Test Case.
- As we're dialing into an IVR, set the channel to Voice
-
Enter a Test Case Name and set the Test Type to Inbound
- Enter the Called Number, this is the number that Cyara will dial to connect to your IVR. For the purposes of this test, we recommend using a unique dial-in number for your IVR. This unique number must trigger a flow within your IVR that will recite the Connection ID.
- Scroll down to the Associated Steps section and click New Step.
- Step 0 of the Test Case will now appear, this is the initial time to connect step so leave these values as their default and click the Add Step button.
- Click on New Step again to add Step 1 to your Test Case and complete the following details.
- Description - A description of the activity being performed in this step, we recommend "Collect ConnectionID".
- Voice Quality - MSPR
- Reply Type - Speech
- Expect to Hear (Selected) - In the Expect To Hear text box, we can now define the Connection ID variable as "$ConnID" using the AlphaNum Tag.
Enter the following for the Expect To Hear text.- {AlphaNum $ConnID}
- {AlphaNum $ConnID}
- Reply With (Selected) - Once the Connection Id has been transcribed, text within this Reply With box will be played, we recommend entering a simple phrase here that your IVR will recognize and terminate the call upon hearing. (E.g "Okay Thank You Bye")
- Leave the remaining values at their default and Click Add Step, Your step will look as follows;
- On the Test Case screen, click Save and Exit to save your changes.
Running the Cyara Test Case
- Open the Test Cases & Blocks menu from the top navigation bar in your Cyara Portal.
- Click on the Test Case that you have built earlier.
- Scroll down to the bottom of this Test Case and click Save and Run to run the Test Case.
- Wait a few moments for Cyara to place the call and run through the Test Case Steps, once the call is completed you will be redirected to the Test Case Results screen.
- On the Test Case Results screen you can see the result of each Test Case Step, and for the Step that contains the Expect to Hear ConnectionID Variable, the detailed result will show the captured Connection ID from the call.
Example API Route
The example Test Case must now be successfully validated. Click the Save and Run button to run this Test Case. Once the Test Case Validation has completed, take note of the TestResultID which will be included in the URL of the validation screen. (e.g testResultId=674715). To format the API route correctly, you will also need your Cyara Account ID, which is included in the URL of your Cyara Portal after /cyarawebportal/, (e.g cyaraportal.us/123/ has the AccountID of 123).
An API route can be used to extract the saved value of the declared Connection Id Variable from Step 1 of the Test Case ($ConnID).
Here is an example API Route using the Cyara 3.0 API to extract the Connection Id from a Test Case built as above.
/v3.0/accounts/{accountId}/{channel}/testresults/{testResultId}
Replace each of the following details with your own identifiers.
- {accountId} - The ID of your Cyara Portal Login Account that has access to the Test Case.
- {channel} - As this is a Voice Test Case enter "Voice".
- {testResultId} - The ID of the successful Validation of the Test Case.
This will return a longer JSON object with Detailed Results for each Step within your Test Case. As we're trying to obtain data from Step 1, look for the "stepNo": 1 block as follows.
{
"stepNo": 1,
"type": "Voice",
"stepResult": {
"result": "Success",
"detail": "Matched with confidence: 97.5%. Variables: ConnId=010A02E3D35B4318",
"category": "NotSet"
},
"response": "00:00:00.0290000",
"duration": "00:00:13.7240000",
"confidenceScore": 97.5
}
In the above example, the Variable that we originally set of ConnID is storing data in the Detailed Result field for Step 1. Using Regex or another data transformation method, this ConnID Variable value can be extracted using the API route above.
Comments
0 comments
Please sign in to leave a comment.