actiWATE TWA
Section contents
Overview
actiWATE TWA (Test Writing Assistant) is a plug-in for MS Internet Explorer that is intended to assist the test writing process. TWA facilitates automation of the most routine part of the process - writing code that finds HTML object (such as tables, buttons and links) on HTML page. Now you do not need to view source code of HTML page in order to figure out how to find particular HTML object.
General usage scenario
The following is a typical scenario of TWA usage:
- Run MS Internet Explorer.
- Activate TWA plug-in by pressing button Finder Tool in TWA toolbar or using hot-key Ctrl-1. TWA plug-in will open TWA window where generated code will be displayed. If TWA toolbar is not visible you can use the menu item View > Toolbars > Test Writing Assistant to make it visible.
Picture 4 Activate Test Writing Assistant
- Select an HTML object and click the right mouse button. TWA will show a popup menu with alternatives of the code that find the selected HTML object.
Picture 5 Select HTML object
- Choose the most suitable option. Selected code will be copied to TWA window.
Picture 6 Generated code
- Press the button Copy to clipboard to copy generated code to the clipboard and paste it into a test. When the generated code is no more needed clear TWA window content using the button Clear. You can select a custom set of lines of code to copy using mouse. You can also copy a single line of code using double-click.
Working with frames
actiWATE TWA allows generating code fragments, which can be easily used along with switchTo() method, which is useful when testing frame enabled web applications. As described in sections actiWATE Framework: Test context and actiWATE Framework: Working with frames actiWATE Framework provides method switchTo() so that user can avoid code duplication when working with HTML elements inside frames and inline frames. In order to write a code, which uses such technique with the help of TWA perform the following:
- Select a frame and necessary HTML elements inside the frame using TWA (see General usage scenario).
- Unselect Frames checkbox. When this checkbox is unselected, code fragments for HTML elements from the frame don't contain code that finds appropriate frame. Steps 1 and 2 can be done in the reverse order: unselect checkbox and then select HTML elements. In this case popup menu with alternatives will show code fragments without code to find frames.
Picture 7 Unselect Frames checkbox
- Copy code fragments into a test and add code to switch test context and perform actions over HTML elements.
switchTo(frame("main"));
setText(textField("username"), "jsmith");
setText(textField("password"), "pass");
click(button("login"));
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
|
 |
 |
 |
 |
|