18.104.22.168.Recording a Test
MarathonITE provides an inbuilt recorder that you can use to record your test script. For recording a test script, follow the below steps:
- Create a new test script
File -> Newselect New Test Case option. Alternatively, you can 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 appropriately positioned so that you can start recording.
- Start recording
You can start recording your script. Use the Record toolbar button for starting the recording. Alternatively, you can use the
Marathon -> Recordmenu item or use Ctrl+R keystroke to start recording.
MarathonITE starts a new recording. You will see a Wait message and MarathonITE starts your application in the browser. The main window is closed and a Control Center window is displayed.
- Perform operations on the application
You can use the application as it is used normally. Each of the operations performed are recorded as script elements by MarathonITE. The control center window displays the recordings of the last few operations.
For this test, we perform a simple search operation. Enter Hello World into the search field and press ENTER. DuckDuckGo search is performed and the results are shown in the browser.
- Adding assertions
A good test case not only includes the sequence of operations, but also includes checkpoints that verify that the operations are processed correctly. While using MarathonITE you can add assertions to the script by using the assertion window.
Move the mouse cursor to the first result in the search results and press Control+RightClick. You can include assertions for any properties for the currently selected component into the script. Select the Text property and click on the Insert Assertion option of the bottom of the window. MarathonITE inserts an assert_p call into the script. Close the window by clicking on the close button.
- Finish recording
We completed recording of our first test. You can finish the recording by clicking on the Stop Recording button on the control center window. MarathonITE will display the main window again – now the script editor will contain the recorded script.
- Save test script
File -> Saveoption to save the test script into a file. We save it as search_test.rb.