Help documentation

Recording in Twist

The following documentation is applicable for Twist 2.2 and above.

Twist's Recorder allows testing of applications to be automated using record and playback options. Twist allows you to record an entire Scenario with multiple workflows and steps. During the recording process, the recorder creates Twist Project driver (based on the driver that was configured for the project) specific scripts for the actions performed in the Browser or User Interface for each step of workflow.

There are multiple ways to record.
  • You can record all unimplemented steps in a single recording session using the record button on the editor toolbar.
  • You can record a specific unimplemented step by invoking Quick Fix
  • You can re-record an already implemented step by invoking Quick Fix

Recording multiple steps in a session

Let us take an example of recording feature in an web application, and we will assume that Sahi is the driver we have chosen for this particular project.

Prerequisites for recording:

  • The Twist project should have been created with Sahi driver in the Advanced options.
  • Sahi allows recording with either Internet Explorer (IE) or Firefox. We recommend using IE7+ or FireFox 3+
  • All the preceding scenario elements (including any contexts, business workflow fixtures, business workflow steps and business rules tables) from where you want to start recording should be implemented and error-free

  1. As an example, we consider a shopping cart scenario, in which the user searches for a particular book and adds that book to the shopping cart
  2. Create a Business Workflow - Add Items .
  3. Create the underlying fixture by invoking Quick Fix or Ctrl+1 on the Workflow.

    You don't necessarily have to create the fixture in advance as you can create it during the recording session. However, to keep it simple we will create the fixture in advance.

  4. Describe the business workflow as a sequence of steps. At this point, all the steps are unimplemented. Add items to shopping cart
  5. Click the Record button on the scenario editor. This will launch Twist Recorder and open up the browser for recording.
  6. Twist recorder will playback the contexts and halt at the first unimplemented step, in ready state, for you to take action.

    Twist recorder
  7. Click on the record button. This will initialize recording for the current step, and any action that you perform on the browser will be getting recorded.

    Twist recorder
  8. Search for the book on your favorite website and click the Save Recorded Step button. The Twist recorder will save the recorded events for that step in the chosen fixture. You can also choose to Discard the recording if you want to start recording this step again.

    • By default the first fixture of the Business workflow is selected in the combo box. The combo box also lists all the fixtures across the current Twist project. For the subsequent steps in the same workflow, the last used fixture is selected by default. As a user you have an option of choosing another fixture as appropriate.
    • If you have an unimplemented step, like search books with text "Arthur Conan Doyle", repeated in the scenario, then on recording of the first step search books with text "Agatha Christie", the repeated step (intent) will also get implemented. However, within the same recording session, Twist will not detect the repeated step as implementation and will halt at the step, ready to record. The Twist Scenario Editor will reflect the step as implemented. You can overwrite the previous recording or just execute the step manually to retain the previous recording.

  9. Twist recorder then proceeds to next step and halts for you to take action again. If you want to keep this step as manual, click on the Execute Manually button. You can perform required actions on the browser, Twist recorder will not save the actions performed and leave the step as unimplemented/manual.

    Twist recorder
  10. You can thus record multiple steps as explained above. You may also click on the End Session button to exit from the recorder at anytime. All the previous recorded steps will be saved except for the current one.
  11. While recording, the scenario editor will reflect the steps recorded or left unimplemented.

Record a specific step

You can also record a specific step. Let us assume that you have recorded the step search books with text "Agatha Christie" and now want to record the step add book "Five Little Pigs" to shopping cart . To do that, navigate to the unimplemented step and press the Quick Fix shortcut key (Ctrl + 1) and select Record this step option.

Twist recorder
  • Twist recorder will playback the step search books with text "Agatha Christie"

    Twist recorder
  • Twist will consider any unimplemented step prior to the requested step as manual and will prompt for the step find book "Five Little Pigs" to be manually executed.

    Twist recorder
  • When Twist Recorder reaches the specific step, add book "Five Little Pigs" to shopping cart , it will initiate recording for the step.

    Twist recorder
  • Click on the Save Recorded Step button when you are done executing all required actions on the browser. Twist recorder will save the scripts for that step and will exit immediately after. The subsequent steps are ignored.

Re-record a specific step

You can also re-record a previously recorded step from scenario editor. The flow is similar to recording an unimplemented step as explained above, using Quick Fix. However, you can not change the fixture for the implemented step during re-recording.