Status: Draft

Debug and Test with the Debugger

The Debugger allows you to view:

  • Technical and functional events exchanged during execution,
  • Application and page evolutions,
  • Scenarios and steps executed.

When you start a project in Debug mode, and depending on the chosen debug options, the Debugger is launched in:

  • A popup window if the “popup mode” option is selected
    ,
  • A Debug perspective if the “embedded mode” option is selected
    .

Regardless of the choosen mode, the Debugger is composed of the following parts:


Menu 'File'
Save DebugSession Save the whole event historic on disk.
The event historic can be saved at any time and it will get automatically saved when execution stops.
Saving Debug session enables to debug offline (see Debug offline with DebugSessions).
Embed in Desktop Studio Embed the Debugger in Desktop Studio.
Menu 'Debug'
Refer to Desktop Studio Commands Reference for a description of 'Debug' items.
Menu 'Settings'
Topmost If checked, allows keeping the Debugger in the foreground position of the existing windows on the screen.
Event historic
Show all events Displays the whole events historic in the "Events" View
Show last 30s Displays only the last 30 seconds of the events historic in the "Events" View
Show last minute Displays only the last minute of the events historic in the "Events" View
Show last 2 minutes Displays only the last 2 minutes of the events historic in the "Events" View
Menu 'View'
Status Bar Hides/shows the Status Bar
Replay Toolbar Hides/shows the Replay Toolbar
Debug Toolbar Hides/shows the Debug Toolbar
ToolWindows
Events Hides/shows the "Events" View
Pages Hides/shows the "Pages" View
Scenarios Hides/shows the "Scenarios" View
Handlers Hides/shows the "Handlers" View
Filter Hides/shows the "Filter" View
Tester Hides/shows the "Tester" View
Screenshots Hides/shows the "Screenshots" View
PageViewer Hides/shows the "PageViewer" View
Details Hides/shows the "Details" View
Context Hides/shows the "Context" View
Layout
Save Saves the current layout (see Layout management)
Restore Restores the previously saved layout(see Layout management)


The “Events” View displays all the events generated by Desktop Agent during execution.

All events are time-stamped, the oldest at the beginning of the list and latest at the end of the list.
The timestamp can be hidden by using the 'Show timestamp' item of the Contextual menu.

Icons at the head of each line indicates the type of the line:

Event not handled by Project code
Event handled by Project code.
Double-click on such events expands the line to display executed actions
Log messages (type 'information')
Log messages (type 'warning')
Syntax errors or log messages (type 'error')
Command executed in the Debugger.
Double-click on such events expands the line to display executed actions

Contextual menu

The “Events” View has a contextual menu allowing the following actions:

Menu itemDescription
Show event detailDisplays the event's detail in the "Detail" View
Show in Scenario ViewSelects the event's handler in the "Scenarios" View
Show/hide actionsExpand/collapse the selected line to display code trace lines associated
Hide all actionsCollapse all the lines to hide code trace lines associated
Show/hide out of search events
Show timestampShow/hide the line timestamp
Show in Page ViewerDisplay the Page captures associated with the event
Insert code in TesterInsert corresponding code in the "Tester" View
Insert code in Tester with InstancesInsert corresponding code in the "Tester" View with instance values
Replay from this event
Clear listDeletes all the events displayed in the list
Clear list before this eventDeletes all the events before the selected event
Show all events Displays the whole events historic


Limit the list of events displayed

There are three ways to limit the list of displayed events:


Using the Event historic duration

By using the 'Settings/Event historic' item of the Main menu, we can limit the historic duration displayed:

  • To the last 30 seconds,
  • To the last minute,
  • To the last 2 minutes.

Each time a new event is received, the list gets updated in order to reflect historic duration choice.

Using the Contextual menu, it is possible to:

  • Remove all the events from list,
  • Remove all the events before the selected event.

Note that the events removed from the display are not actually deleted.
They can be displayed back by using the 'Show all events' item from the Contextual menu.


Using the Scopes

Using the "Scenarios" View, we can limit the list of events displayed to:

  • The Scope of a Step. Only the events received between the start and the end of the Step are displayed,
  • The Scope of a Scenario. Only the events received between the start and the end of the Step are displayed.

When a Scope is set, it is displayed on the right of the Search Bar (1).
The Scope can be cancelled by clicking on the .


Using the Filter View

Using the "Filter" View, we can filter the list events displayed:

  • Based on the Application,
  • Based on the event name.

Note that a filtered event is never displayed, even if it matches the current Scope.
The only way to display a filtered event is to change the Filter.


Display actions

For events having actions associated with (Handled events and Studio Commands, see above) , we can display the executed actions by double-clicking on the line or by using the 'Show/hide actions' item from the Contextual menu.

Icons at the head of each line indicates the type of actions:

Code instruction
Code instruction
Messages
Log messages (type 'information')
Log messages (type 'warning')
Syntax errors or log messages (type 'error')
Framework status notification
Scenario start
Scenario end
Step start
Step end
Handler run
Handler set or reset
Other


Search events or actions

We can search events or actions in the Events View by using the Search Bar:

To search a text:

  • Enter the 'searched text' in the entryfield,
  • Click on the button.

The events list is filled with the search result:

  • Found events or actions are highlighted in green,
  • Other events are hidden (we can show/hide them using the 'Show All' button),
  • If an action is found, other actions executed on the same event are disabled.

Note that the search is performed within the limits of the list of events displayed.
For example, a filtered event will never be found, even if it matches the search.

To cancel the search, click on the button.


Display event or action Detail

We can display one event or action details by selecting the 'Show event detail' item from the Contextual menu.
The “Details” View displays:

  • For an event, the data associated with the event,
  • For an action:
    • The action's parameters,
    • The return value,
    • The Item on which the action is executed.

If the “Details” View is already visible, simply select one event or action to display its details.


Display Screenshots

In order to automatically capture screenshots, check the 'Capture screenshots' option in the Manage Debug options.
In this cas, Interactive automatically captures screen image during execution based on Page LOAD and UNLOAD events.

To display the screenshot associated to an event, display the “Screenshots” View and select the desired event.
If the “Screenshots” View is already visible, simply select one event or action to display its associated screenshot.

Note that:

  • If an event has no associated screenshot, the screenshot of the previous event is used,
  • Unlike the Page captures, the screenshots are simple images. It is impossible to select Components on screenshots.


Display Page Capture

If an event or action is associated to a Page, we can display the Page Capture associated with the Page by displaying the “PageViewer” View.
If the “PageViewer” View is already visible, simply select the event or action to display its associated Page Capture.

If it is associated to a Page Item, the corresponding recognized Items are highlighted in the Page Capture.




This view displays the tree of Applications, Pages and Items declared in the project.
For each element of the tree, the following color code is used to display the loading status:

GreenThe element is loaded
GrayThe element has never been loaded
BlackThe element has been loaded but is now unloaded

Note:

Contextual menu

The view has a shortcut menu allowing the following actions:

Menu itemDescription
Goto definition Navigate to Page/Item declaration in Explorer Perspective
Show in Page ViewerDisplay the Page captures associated with the Page or Item
Show in Page TesterDisplay the Page captures associated with the Page or Item
Start Start a new instance of the Page
Update Items valuesDisplay Items values
Highlight Highlight the recognized Page in the monitored application
Highlight Items Highlight the recognized Items in the monitored application
Search in Events viewSearch in the "Events" View the events received for this Page and display handling actions
Insert code in TesterInsert corresponding code in the "Tester" View
Insert code in Tester with InstancesInsert corresponding code in the "Tester" View with instance values
Hide never loaded Applis/PagesHide/show never loaded (gray) Applications and Pages
Copy NameCopies the name of the selected Item, Page or Application in the clipboard
Copy ValueCopies the value of the selected Item in the clipboard


Display Items values

To display Items values, open the contextual menu on the Item or on the Page and select the 'Update Items values' menu item.

For simple Items, the Item's value is collected in the Page and displayed after the Item's name.

[Item name] = [value]

For multiple Items:

  • The Item's count is collected and displayed before the Item's name (1),
  • The value of the first Item's occurence is displayed after the Item's name,
  • For multiple WEB Items, the count can't be collected without collecting all the values. To reflect that, [??] is displayed in place of the count value.

We can display all the values of a multiple Item by double-clicking on it.
A subtree opens (2) displaying all the values with the corresponding index value.

If more than one instance of the Page is loaded, select the desired instance in the 'Instances combobox' to display its Items values (see Multi-instance management).

Note:

  • It may happen that the running project describes Items that are not present in the running application.
    The view refers in this cas the malfunction by the following message:
    [Item name] = [Pilot name] - ERROR ...
  • Using the 'Update Items values' command generates a line in the "Events" View.
    By double-clicking on this line, we can display all the actions performed in response to this command.


Multi-instance management

This view displays information about multi-instances of Applications or Pages:

  • For Applications, the current and max number of running instances of the Application (1) are displayed,
  • For Pages:
    • The current (2) number of running instances of the Page, across all running instances of the Application,
    • The max number of running instances of the Page in the same running instance of the Application,
    • A combobox allowing to select the Page instance used to display Items values (3).

Note:

  • The current and max values are only displayed if they are greater than 1.




The “Scenarios” view in Desktop Studio displays a tree that shows the running or ended Scenarios (1), the Steps (2) and the Handlers (3).
It also displays, for each Handler, the Log messages and a trace of executed Commands (4):

  • Scenario and Step items display the Scenario or Step name its internal Id and its starting timestamp.
  • Handler items display events handled inside each Step.
    The special 'Init' handler display commands executed at the starting of Steps or Scenarios,
  • Command items display the automatic trace generated by the framework,
  • Log and Error items display script trace generated via the ctx.log command.

Each item has an icon and colors indicating the type of item and its status (see Item's icons and colors meaning).

We can navigate in the script to the code corresponding to an item by using the 'Goto Definition/Code' menu item in the Contextual menu (see Navigate to Code).
Note:

  • Handlers executed outside the scope of a Step (for example: 'GLOBAL.Start' handlers) are displayed in the second column (see Columns management),
  • Log items visibility is managed in a special way (see Log and Errors display),
  • We can hide the timestamp by using the 'Show timestamp' item in the Contextual menu or the button in the Toolbar,
  • Command items icons can be hidden using the button in the Toolbar.


Columns management

The 'Scenario View' displays data in a structured way by using differents columns.

It can display several Scenarios executing simultaneously, by setting each Scenario in a different column (see columns (3), (4) and (5)).

Column management can be done by using the Column header:

It allows to:

  • Hide/Show a column by clicking on the button,
  • Manage column width by dragging splitters between columns.

The first two columns have a special meaning:

  • 'Events column' (Column 1) allows to display/hide technical events (1),
  • 'OutOfScenario column' (Column 2) allows to display/hide out of scenarios handlers (2) (for example: 'GLOBAL.Start' handlers)

Note:

  • 'Events column' and 'OutOfScenario column' have independant width. Others columns (Scenario columns) have all the same size,
  • It is sometimes difficult to reduce columns width.
    If the problem occurs simply reset the columns width by using the button in the Toolbar and then expand the desired columns.


It is possible to navigate inside the scripts to the code corresponding to an item by using the 'Goto Definition/Code' menu item in the Contextual menu:

  • 'Goto Code' on a Scenario item navigates to the definition of the Scenario,
  • 'Goto Code' on a Step item navigates to the definition of the Step,
  • 'Goto Code' on a Handler item navigates to the 'set' command of the Handler (wait, on, once, waitClose, …),
  • 'Goto Code' on a Command or Log item navigates to the command.

Take care: this navigation is rather approximative.
The link between trace item and code in Scripts is not done by script line number, but by search in Scripts code map.
To minimize navigation errors, use unique Names for Scenarios and Steps.

Note:

  • 'Goto Code' on an item searches for the first matching entry in Scripts code map.
    For example, if we have two 'ctx.log' commands in the same Handler, 'Goto Code' on the secong Log item will navigate on the first 'ctx.log' commands in the Handler.


Log and Errors display

Command items are displayed only if their corresponding Handler's item is expanded.
Log and Error items visibility is managed in two different ways:

  • An Error item is always visible if the item of the Scenario in which the error occurs is visible (even if collapsed),
  • A Log item is visible if the item of the Scenario in which log is generated is expanded.
    We can display Log items the same way that Error items by using the button in the Toolbar.

This way of displaying Log and Error items allows a synthetic view of the log generated and a quick access to the Handler where log message occured.

You can display the execution context of a log message via the 'Display executing context' menu item in the Contextual menu or by clicking on its icon (1).
The executing Handler/Step/Scenario are expanded to display the Log item within its execution context.


Item's icons and colors meaning


For each item in the tree, the following color code is used to display the activity status:

Gray background (1)The Scenario has ended
Red text (2)The item (Scenario, Step, Handler) is in Error
Green background (3)The Scenario is 'running'
Italic font (4)The Scenario or Step has ended
Normal font (5)The Scenario or Step is running

Icons at the head of each item of the tree indicates the item's type:

Scenario, Step, Handler items
Scenario
Step
Handler
Command items
Start scenario
End scenario
End step
Set handler
Framework Command
Script Command
Log items
Information
Warning
Error
Question
Data
Other


Toolbar


The view has a toolbar allowing the following actions:

Expand All
Collapse All
Reset column width
Stop all running scenarios
Hide/Show scenario history
Show/Hide timestamps
Show/Hide Log
Show/Hide command icons
Search text inside the View


Contextual menu

The view has a shortcut menu allowing the following actions:

Menu itemDescription
Show event detailDisplays the event's detail in the "Detail" View
Show in Page ViewerDisplays the Page captures associated with the event
Show in Page TesterSelect the corresponding Page/Item in the "Tester" View
Goto Definition/Code
Insert code in TesterInsert the corresponding code in the "Tester" View
Insert code in Tester with InstancesInsert the corresponding code in the "Tester" View with instance values
Replay from here
Restart this ScenarioStart an ended Scenario
Stop all running ScenariosStop all currently running Scenarios
Stop this running ScenarioStop the selected running Scenario
Stop this running StepStop the selected running Step
Hide Scenario historyHide/show all ended Scenarios.
Running Scenarios remain visible
Show timestampShow/hide the line timestamp



Contextual menu

The view has a shortcut menu allowing the following actions:

Menu itemDescription
Show in Page ViewerDisplays the Page captures associated with the event waited by the Handler
Set Scope in Events viewSet the current scope in the "Events" View
Display actions in Events viewSearch in the "Events" View the events that run the Handler and display handling actions
Search sets in Events viewSearch in the "Events" View the actions that change the items activity status
Insert code in TesterInsert the corresponding code in the "Tester" View
Insert code in Tester with InstancesInsert the corresponding code in the "Tester" View with instance values
Restart this ScenarioStart an ended Scenario
Stop all running ScenariosStop all currently running Scenarios
Stop this running ScenarioStop the selected running Scenario
Stop this running StepStop the selected running Step
Clear Scenario HistoryClears all ended Scenarios.
Running Scenarios remain visible
Show Scenario history
Show timestampShow/hide the line timestamp




This view display all the Handlers that have been set, inside or outside Scenarios, during the execution.
These Handlers are grouped by Process, Application and Page.

Each Handler displays the name of the handled event and the number of times it has been run (for example: [2 runs]).

This view can be filtered based on Application and Process by using the "Filter" View.


Contextual menu

The view has a shortcut menu allowing the following actions:

Menu itemDescription
Show in Page ViewerDisplays the Page captures associated with the event waited by the Handler
Display actions in Events viewSearch in the "Events" View the events that run the Handler and display handling actions
Search sets in Events viewSearch in the "Events" View the actions that change the item's activity status
Insert code in TesterInsert corresponding code in the "Tester" View
Insert code in Tester with InstancesInsert corresponding code in the "Tester" View with instance values
Hide never run HandlersHide/show never run Handlers




} }
<todo @plong>"Tester" View</todo>\\
to be finalized
</WRAP>

----
====="Filter" View=====
----
This view enables to filter data displayed in the following view:
	* [[#events_view|"Events" View]],
	* [[#pages_view|"Pages" View]],
	* [[#handlers_view|"Handlers" View]].
\\
====Filter on Applications or Processes====
<WRAP indent>
{{ :guides:studiov3:CPV3_FilterViewAppli.png?300|

To filter on Applications or Processes, select the 'Applications' tab item.
The view displays all the Applications and Processes declared in the project.

It is possible to:

  • Check the Applications or Processes to exclude,
  • Uncheck all the Applications or Processes to remove filters by clicking on the 'Exclude none' button,
  • Check all the Applications or Processes by clicking on the 'Exclude all' button.

There is no need to validate, the current filter is automatically applied when modifying the options.
The choices are saved in the .user project file.


Filter on Events

To filter on Events, select the 'Events' tabitem.
The view then display all the Events which have been received during execution of the project.

You can then:

  • Check the Events you want to exclude
  • Uncheck all the Events to remove filters by clicking on the 'Exclude none' button
  • Check all the Events by clicking on the 'Exclude all' button

You don't need to validate, the current filter is automatically applied when you modify the checks.
Your choices are saved in the .user file of the project.




This view display the internal context of the Desktop Agent engine.

To update data, use the 'Refresh' menu item of the contextual menu.

When selecting a node, the corresponding JavaScript command allowing to get the node value gets displayed (1).

The view has a shortcut menu allowing the following actions:

Menu itemDescription
Insert code in TesterInsert the corresponding code in the "Tester" View
Copy valueCopy the value of the selected node
RefreshUpdate displayed data




Tool windows can be docked anywhere by using their titlebar and drag&drop (see Docking Tool windows).
Some of them can be closed by using the cross button of this titlebar.

Caution:

  • If the Debugger is in Topmost state, the Docking Guide will not be displayed.
    To view the Docking Guide during the drag&drop operation, temporary remove the Topmost mode.

All available Tool windows are listed in the 'View\Tool Windows' menu.
By checking/unchecking one Tool window, we can show/hide it.

The customized Layout can be saved with the View\Layout\Save menu item in the Main menu.
This Layout will then be restored the next time the Debugger starts.

To restore this Layout without restarting the Debugger, use the View\Layout\Restore menu item in the Main menu.