Presentation is loading. Please wait.

Presentation is loading. Please wait.

Gannon University Frank Xu

Similar presentations


Presentation on theme: "Gannon University Frank Xu"— Presentation transcript:

1 Gannon University Frank Xu
Abbot Tutorial Gannon University Frank Xu CIS software design and testing 9/22/2018

2 Abbot – A Better ’Bot A GUI testing framework for Swing
Works seamlessly with Junit Uses some Junit 3 features Can be used to create Unit tests for GUI components Functional tests for existing GUI apps Open source CIS software design and testing 9/22/2018

3 Goals of the Abbot framework
Reliable reproduction of user input High-level semantic actions Scripted control of actions Loose component bindings CIS software design and testing 9/22/2018

4 Launch the script editor.
Unzip to a folder called: abbot-1.0.2 Type command: abbot CIS software design and testing 9/22/2018

5 Create a new script File->New Script For example,
Launch defines a class and method to invoke to launch your GUI.  Terminate disposes of all GUI components generated by the launch step. For example, invoke the main(String[] args) method in class example.MyCode  with no arguments, CIS software design and testing 9/22/2018

6 Save scripts: \abbot-1.0.2\codescripts
CIS software design and testing 9/22/2018

7 Test->Launch  display the GUI under test. The example code will display a frame with a variety of sample components. CIS software design and testing 9/22/2018

8 Record some user actions.
Capture->All Actions (or shift+F2), perform some user actions in the GUI. If you haven't already launched the GUI, the editor will launch it for you. The editor will detect as many high-level semantic events as it can and insert raw mouse motion and button events for what it doesn't recognize. When you get the GUI to a point that you want to make some tests of its state, press shift+F2 or activate the editor window to suspend recording. The recording so far will be inserted into the script as a sequence of steps. CIS software design and testing 9/22/2018

9 All captured activities
Move Resize Select tabs close CIS software design and testing 9/22/2018

10 Replay: click Run CIS software design and testing 9/22/2018

11 Add some assertions Move the mouse over the component in your GUI for which you'd like to add a test and press shift+F1. That component will be selected in the component browser tree in the bottom half of the script editor. The hierarchy view presents the full hierarchy of components that have been created. Once you've selected a component, its associated properties will appear in the pane to the right. Select a property ("Text" on a JButton, for instance), Click the Assert equals button to insert an assertion into the test. Repeat as necessary for other components, or press shift+F2 to continue recording actions. Note that if a component you'd like to test is within a modal dialog, you'll need to explicitly add a reference withalt+shift+F1 and add the assertion after the dialog has been dismissed. CIS software design and testing 9/22/2018

12 Add some assertions 1. Shift F1 5. Type assertion 2. hierarchy view
3. Properties 4. Click Assert equals CIS software design and testing 9/22/2018

13 replay Change expected value to something else.
CIS software design and testing 9/22/2018

14 Homework earn/index.html#CelsiusConverter CIS software design and testing 9/22/2018

15 Classpath CIS software design and testing 9/22/2018

16 Another tutorial Abbot_tutorial_2.docx CIS software design and testing
9/22/2018


Download ppt "Gannon University Frank Xu"

Similar presentations


Ads by Google