Web Recorder
Twist's Web Recorder allows testing of web-based applications to be automated using record and playback options. During the recording process, the recorder creates Selenium scripts for the actions performed in the browser.
It may be noted that currently Twist supports only Firefox during the Recording mode but supports both IE and Firefox in playback mode. Browser mode can be changed in <source_folder>/twist.properties (The properties file can be opened from Project explorer view).
Working with the Web Recorder
Prerequisites for recording:
- The Twist project should have been created with 'Selenium' driver in the Advanced options.
- Note that Firefox 2.x and above should be installed as it is required to perform recording.
- that all the preceding scenario elements (including any contexts, business workflow fixtures, business workflow steps and business rules tables) to this workflow step be implemented and error-free.
- Let us consider a shopping cart scenario for books, which will search for a particular book and adds that book to the shopping cart
- Create a Business Workflow. Create the underlying fixture by invoking Quick Fix or Ctrl+1 on the Workflow.
- Create the workflow step that you want to record.
In this example, navigate to the first step search for "books" written by "Agatha Christie" and press the Quick Fix shortcut key (Ctrl + 1).
- Select the Record as method in class using Selenium. This will invoke the recorder and open up the Twist browser for recording.
- Enter the corresponding URL to load the Books Shopping Cart application
- Use the option Search to find book "Five Little Pigs" and add the book found to the shopping cart.
- Twist Web Recorder captures all user interactions in the Browser and records them as Selenium scripts.
- Click on the Done button to exit from the recorder, when done.

- Note that the actions captured during recording are present in the underlying code. Observe that the object ids are stored as constants in the methods.

Record Assertions
Some of the assertions can be recorded in Twist.

The assertions that are supported are
Supported since Twist 1.1 release.

The assertions that are supported are
- Assert text present - assert the selected text to be present in the page. Enabled only when something is selected.
- Assert window title - assert the current window title.
- Assert location url - assert the current window location url.
- Assert element present - assert that the selected element is present.
- Assert element is visible - assert that the element is visible.
- Assert element is editable - assert that the element is editable.
- Assert element's value - asser the element's value to be the current value. For a non-form element for eg. <SPAN> the innerHTML is asserted.
