Testing SRGS 1.0 Grammars With Tellme Studio

This topic gives you the basic VoiceXML files you need and instructions for testing your grammar in a simple application.


To do the testing with the Tellme Platform, you need to be a developer member of the Tellme Studio: Go to http://studio.tellme.com and click the Join Studio button. Fill out the required information in the Become a Tellme Studio Developer form and click the Submit button. Credentials for using Studio online and by phone are then e-mailed to you.

This topic includes the following sections:

  • Test application for grammars returning a single string
  • Logging the grammar match result
  • Test application for grammars returning a multi-property object
  • Running the test VoiceXML applications

Test application for grammars returning a single string

This simple VoiceXML application can be used to test any grammar that returns a single string to the application. The string is automatically placed in the result variable, and the application repeats it to the caller in the <filled> section.

<?xml version="1.0"?>
<VXML version="2.1" revision="4"
<form id="mainDialog">
   <field name="result">
      <prompt>please say something</prompt>


         <log>raw result is <value expr="result"/></log>
         <prompt> thank you </prompt>
         <prompt>you said <value expr="result"/> </prompt>
      <noinput> </noinput>
      <nomatch> </nomatch>

Logging the grammar match result

You can log the result variable using the <log> tag and then view the log. This is an excellent way to verify that your grammar is returning what you want it to return. In the test application above, the statement <log>raw result is <value expr="result"/></log> writes the value of result (which is where the application puts the grammar match, if any) to the log. You can then open the log (see Troubleshooting) to see the value.

Using the log in this fashion is the best way to see exactly what the grammar match was.

Test application for grammars returning a multi-property object

This VoiceXML application is the same as the previous one (Test application for grammars returning a single string), except that:

  • The grammar returned a number of different match values, as properties of a result Object.
  • The <filled> section repeats each variable back to the caller.
<?xml version="1.0"?>
<VXML version="2.1" revision="4" xmlns="http://www/w3/org/2001/VXML" xml:lang="en-US">

<form  id="mainDialog">
   <field name="resultObject">
      <prompt>Please say something</prompt>


         <prompt>thank you</prompt>
            result object dot property one is <value expr="resultObject.property1"/>
            result object dot property two is <value expr="resultObject.property2"/>

            result object dot property three is <value expr="resultObject.property3"/>

            result object dot property four is <value expr="resultObject.property4"/>
            <!-- AND SO FORTH....-->

      <noinput> </noinput>
      <nomatch> </nomatch>

Testing grammars that return multiple values

If your grammar returns a single string, it is easy to use the <log> tags to send the grammar match results to the log file. If, on the other hand, your grammar returns an object, you need one <log> statement for each of the object’s properties. It is often preferable to convert the object’s properties to a single string so that it can be logged more easily. The following JavaScript code does such a conversion.

var result = "";
for (var propi in object) {
   result += object + "." + propi + "=" + object[propi] + "^";

This code steps through the object’s properties (propi) one at a time and constructs a string of the form:

result = "object.property1=value1^object.property2=value2^..."

Running the test VoiceXML applications

Running the test

  1. Copy the appropriate one of the two preceding applications and paste it into an XML editor of your choice.

  2. Add your grammar or grammars and save the composite application file.

  3. Open a browser and go to http://studio.tellme.com

  4. Log in and click the Scratchpad item in the left-hand menu to open the Scratchpad.



    You must be using the Microsoft speech engine to test your SRGS grammar. Click the edit my preferences button in Scratchpad's button bar. In the Tellme Preferences window, check the Use MS Speech Engine box and then click the Submit button. The next time you open Scratchpad, you should see the correct SRGS grammar testing phone number.

  5. Copy your application and paste it into the Scratchpad window.


  6. Click the orange Update button.


    This causes your application to compile. Any errors found in the VoiceXML are displayed in the upper portion of the Scratchpad window.



    Clicking the Update button checks the VoiceXML code for errors. It does not check the grammar syntax beyond validating the grammar as XML.

  7. Call the phone number listed at the top of the Scratchpad window and respond to the "please say something" prompt with the language your grammar expects. If your application has no errors, the match values of your utterances are spoken back to you.


    Plan to always use the same phone when calling Tellme to test an application. Studio offers to remember the number you are calling from so you do not have to log in on subsequent calls.


If you call Tellme to test a VoiceXML application that you pasted into Scratchpad and you get no response, there are errors in your application. You can use the debug log to learn what they are:

Viewing the log

  1. Click the debug log button in the upper left of the Studio window.


    A window opens that lists the available debug logs, with the latest listed first


  2. Click View Log for the most recent log.

    The debug log that opens should help you find the errors. They are shown in red.



    There are no critical errors in this log. The one error in red shows that the VoiceXML application does not terminate correctly, but that is immaterial because the test of your code is completed prior to termination.