How to Work with JSON

JSON (JavaScript Object Notation) is a lightweight data-interchange format that resembles JavaScripts literal notation e.g. { "x" : 5 , "y" : 7 }. JSON is a text format, but in robots JSON is represented and viewed in a structural way similar to the way XML is represented. JSON is treated as its own data format (exactly as HTML, XML and Excel) with its own Page Type. It is not transformed into XML as it were in previous version of Design Studio. That is, the Test Page Type step action may test that the content of the current windows i JSON or not. JSON loaded into the Windows View can come from JSON loaded from a URL or from variables/attributes of simple type JSON. There is a dedicated view that shows JSON both in the Windows View (if you open a JSON variable in this) and in the Variables View (if you choose to view the value of a JSON variable from this) and there are dedicated step actions that only work on JSON.

The following is an example of a JSON text:


                { "answer" : 42,
                  "people" : [ { "firstName" : "Arthur",
                                 "lastName" : "Dent" },
                               { "firstName" : "Ford",
                                 "lastName" : "Prefect" } ] }

In the next section we will describe the structure of JSON and define the terminology we use for describing the various parts of a JSON text.