NexJ Logo

Recording and playback

The AFL application is equipped with a recorder that lets you see what is being used or clicked on.

Enabling the recorder through a URL

In deployed environments, by default, the recorder is off. To enable the recorder, add ?record=1 as a parameter to the URL.

Using the recorder

  1. Launch the AFL app using the server Scheme console.
  2. In Chrome (the only supported browser at this time), launch the AFL portal application (for example, http://localhost:7080/nexj/ui/portal).

  3. Click in the application.

  4. Click Ctrl + F11 to start or stop recording.

  5. Once you have stopped recording, click Ctrl + F12 to export the script. The exported script will appear in the Chrome Console output (Chrome developer tools, accessed with F12).

  6. The resulting output will be your unit test, without any assertions.

Example of recorder output

(sim'use "navigator/1")
(sim'click)
(sim'use "workspaces/Contacts/refEntityNavigator/EntityList/groupLayout/tabPerson/grdEntity#cell.2.2")
(sim'click)
(sim'use "workspaces/Contacts/p0/view:#1")
(sim'click)
(sim'use "workspaces/Contacts/p0/tabPersonDetail/refPersonCommunications/refPersonCommunications/ref/gridTelcom/1#tool")
(sim'click)
(sim'use "workspaces/Contacts/p0/view:#2")
(sim'click)
(sim'use "workspaces/Contacts/p0/tabPersonJournal/refPersonJournalActivities/ref/gridActs/0/view:#tool")
(sim'click)
(sim'use "workspaces/Contacts/p0/tabPersonJournal/refPersonJournalActivities/ref/gridActs/0/0/0")
(sim'click)
(sim'use "tabFullDetail/grpActDetail/1/tabDetail/frmActDetailEdit/tblLocation/inpLocation")
(sim'click)
(sim'text "location")
(sim'use "OkButton")
(sim'click)