Web Recorder
The following documentation is applicable for Twist 2.1. For version 2.2 or later, please check Recording in Twist.
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 either Sahi or Selenium scripts for the actions performed in the browser depending on the driver you have configured with your Twist Project.
However both Internet Explorer (IE) and Firefox are supported in the playback mode.
If Sahi is the driver on your project, then you can record using Internet Explorer and Mozilla Firefox.
Working with the Web Recorder
Prerequisites for recording:
- The Twist project should have been created with 'Sahi OR 'Selenium' driver in the Advanced options.
- Selenium requires that Firefox 2.x or above be installed as it is required to for recording.
- Sahi allows recording with either Internet Explorer (IE) and Firefox.
- 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
- 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
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 - assert the element's value to be the current value. For a non-form element for ex. <SPAN> the innerHTML is asserted.


