1. Preface
    1. About MarathonITE
    2. Supported Platforms
      1. Java/Swing™
      2. Java/FX™
      3. Web Applications
    3. What's New in MarathonITE 5.0
    4. Change Log a.k.a Version History
    5. System Requirements
    6. Copyright Notice
  2. Getting Started
    1. Introduction to Test Automation
      1. Unattended Testing
      2. Semi Automated Testing
      3. Exploratory Testing
    2. MarathonITE Projects
    3. Your First Project
      1. Java/Swing™ Test Project
        1. Application Under Test - SwingSet3
        2. Creating a Project
        3. Recording a Test
        4. Anatomy of a Test Script
        5. Running Tests
        6. Looking at Results
      2. Java/FX™ Test Project
        1. Application Under Test - Ensemble
        2. Creating a Project
        3. Recording a Test
        4. Anatomy of a Test Script
        5. Running Tests
        6. Looking at Results
      3. Web Application Test Project
        1. Application Under Test - DuckDuckGo Search
        2. Creating a Project
        3. Recording a Test
        4. Anatomy of a Test Script
        5. Running Tests
        6. Looking at Results
    4. MarathonITE Sample Projects
  3. User Guide
    1. Installation and Startup
    2. MarathonITE User Interface
      1. Views
      2. Editors
      3. Output Views
    3. Creating Marathonite Test Projects
    4. Recording Tests
    5. Managing Checklists
    6. Exploratory Tests
    7. Semi Automated Tests
    8. Executing Tests
      1. Executing a Test from Editor
        1. Debugging Scripts
        2. Using Script Console
      2. Executing Tests from Test Runner
      3. Executing Tests in Batch Mode
    9. Organizing Tests
      1. Organizing Tests in Folder Heirarchy
      2. Organizing Tests as Features and Stories
      3. Organizing Tests in Suites
      4. Linking Tests to TMS and Issue Manager
    10. Modularizing Test Scripts
      1. Module Methods
      2. Extract Method Refactoring
      3. Using Data Loops
      4. Convert to Data Loop Refactoring
    11. Data Driven Tests
      1. Convert to DDT Refactoring
  4. Advanced Scripting
    1. Ruby Programming Language
    2. Marathon and Ruby
    3. Selenium/WebDriver Bindings
      1. Java/Swing™ Components
      2. Java/FX™ Controls

3.4.Recording Tests

MarathonITE includes a recorder that you use to record test scripts. Even when you manually create a script, it is best to start with a recorded script. This will ensure that all accessed components are available in the object map.

About Test Scripts

MarathonITE test scripts are regular Ruby scripts. MarathonITE adds some methods to the language run-time. MarathonITE scripts are procedural in nature – this ties in with how you think about tests.

Every test script starts executing at the test method. Before starting the script, MarathonITE uses the defined fixture to start the application. Fixtures themselves are Ruby scripts. When you create a new project, Marathon creates a default fixture in the Fixtures folder. You can use fixtures to create a well-known state for the test case.

1. Selecting an Active Fixture

Before you start recording a test script – you need to select an active fixture. When you create a project, MarathonITE selects default fixture as the active fixture.

Selecting an Active Fixture

You select an active fixture using Marathon -> Select Fixture… menu option. You may also click on the active fixture shown in the status bar to open Select Fixture dialog. From this dialog you can pick a fixture from the available fixtures.

2. Create a New Test Script

Once an active fixture is selected, you should create a test script. Whenever a script is created, MarathonITE records the active fixture in the script.

Marathonite Toolbar - New Option

From the File -> New select New Test Case option. You can also use the toolbar button or press Ctrl+N to create a new test case. MarathonITE opens an Untitled test case in a new editor. The cursor is positioned so that you can start recording.

3. Recording a Script

Marathonite Toolbar - Record

You can start recording your script. Use the Record toolbar button for starting the recording. Alternatively, you can use the Marathon -> Record menu item or use Ctrl+R keystroke to start recording.

Marathonite Control Center

MarathonITE starts recording your actions on the AUT. You will see a Wait message and MarathonITE starts your application. The main window is closed and a Control Center window is displayed.

MarathonITE records any operations that you perform on the application. The Control Center window displays the last few recorded operations.

MarathonITE records operations at a higher level than keyboard or mouse events. In most cases, MarathonITE records the operation when a component looses focus.

Some of the operations that do not change the state of a component do not get recorded by MarathonITE. For e.g, moving into a text-field and moving out without changing the text will not record a operation.

4. Object Spy and Adding Checkpoints

Assertions Window

While recording a script, you can use an object spy to inspect attributes of a component. While keeping mouse pointer on a component, use Ctrl+rightclick to open the object spy window. You can change the currently inspected component, by clicking another component in the application. The Spy window will show the properties and values of the selected component.

The object spy window is also called Assertions Window. From the object spy window, you can insert assertions and wait calls into the test script.

For adding an assertion, select a property and click on the Insert Assertion button. You can adda wait operation by clicking the Insert Wait button.

5. Other Operations

The following operations are available from the control center.
  • Pause
    Pause recording the current script. Till you resume, MarathonITE doesn’t record the operations on the application.
  • Insert Module
    You can insert a MarathonITE module method. We will discuss more about re-usability in later chapters.
  • Insert Checklist
    You can insert a checklist into the script. When you execute the script, MarathonITE pauses the script and shows the checklist. You can fill-up the checklist and include screenshots. More about checklists in Semi Automated Tests chapter.
  • Raw Recording
    By default, MarathonITE records high level operations rather than clicks and key events. By selecting this option, you can let MarathonITE record raw events.
  • Script Console
    Opens up a console window. You can execute any ruby commands to interact with the application.

6. Complete Recording and Saving Test Scripts

When you complete your operations, you can stop the recording by clicking on the Stop button. MarathonITE displays the main window with the recorded script in the editor.

Use File -> Save option to save the test script into a file.

Suggest Edit