OtfExecution

From emotive
Jump to navigation Jump to search

Introduction

The OTF supports to execute a procedure in Dotnet platform or Java platform. Also, there are many ways to execute a procedure such as using command buttons in the Ribbon menu, using shortcut keys or using context menu. Similar to some other IDEs, users can perform execution in the OTF with or without debugging.

When a procedure is executed, the OTF first builds the DLL (running with Dotnet platform) or the JAR (running with Java platform), then it use the DLL or the JAR to run the current test sequence.

A procedure may call other procedures in another document in the same or different projects. As a result, when users execute a procedure, it shall happen as follows:

  1. All the changes in the related projectsTooltip.png shall be automatically saved.
  2. All the related projectsTooltip.png shall be validated and built.
  3. The current procedure and all the called procedures, if any, shall be executed.

After the validation, if there are critical errors in a test sequence, the related project shall not be built and the execution shall be cancelled. All the related errors and warnings of the validation can be found in the Error List tool window. You can skip the validation before the execution by checking the "No Validation before execution" check-box in the "Expert" settings tab of the OTF Settings. However, turning off the validation may result in undefined behaviors of the execution; normally, it skips the node with errors. If there are any problems when building the projects, the execution is also cancelled.


Exclamation.png NOTE:
  • The OTF only allows to execute one test sequence at a time. You can not execute a procedure when another procedure is being executed. The current execution has to be finished or stopped before a new execution is started.
  • All the related test sequences shall be saved in the cache before the test execution so any changes during the execution shall not affect the behavior of the saved test sequences e.g. a node which is deleted after the execution is started is still executed. Only the changes with the variables in the Watch tool window during debugging execution shall affect the behavior of the test sequences (see example below).


Setting Up before Execution

Setting up before execution relates to  the scopes to be executed  and  the platforms to execute .


Scopes of Execution

Executing a procedure  with shortcut keys  or  with command buttons  depends on which scope selected in the "Execute Of" combo-box in the "Runtime Environment" tab of the Ribbon Menu.

There are 4 scopes of execution:


Scope Description
Solution It shall execute the procedure main of the Startup Document in the Startup Project of the Solution.
Current Project It shall execute the procedure main of the Startup Document in the current Project (of the current opened procedure tab or OTL tab).
Current Document It shall execute the procedure main of the current Document (of the current opened procedure tab or OTL tab).
Current Procedure It shall execute the current opened procedure. This scope has no effect when an OTL tab is currently opened.


Platforms to Execute

The OTF runtime supports to execute with Dotnet platform or Java platform. There are many ways to change the execution platform:

  1. Use the "Target Platform" combo-box in the "Status Bar"
  2. Use the "Target Platform" combo-box in the "Runtime Environment" tab of the Ribbon Menu
  3. Use the "Target Platform" combo-box in the "Runtime Environment" settings page of the OTF Settings


Ways of Executing a Procedure

There are 3 ways to execute a procedure: using command buttons in the Ribbon menu, using shortcut keys or using context menu.

Exclamation.png NOTE: The OTF only allows to execute one test sequence a time. You can not execute a procedure when another procedure is being executed. The current execution has to be finished or stopped before a new execution is started.


Using Command Buttons and Shortcut Keys

Below are the Shortcut Keys with their function descriptions:


Command  Button     Shortcut  Key     Mode     Function
Start CTRL+F5 Normal Executes the procedure (see execution scopes) without debbuging.
Debug F5 Debug Debugs the procedure (see execution scopes). Executes from the beginning/current node and suspends the execution at the following node with breakpoint in the test sequence waiting until a debug command/key is clicked/pressed.
Step Over F10 Debug Debugs the procedure (see execution scopes). Executes from the beginning/current node (it does not step into called procedures) and suspends the execution at the adjacent node followed the current node waiting until a debug command/key is clicked/pressed. If there is a breakpoint inside the called procedure, it steps into the called procedure and suspends the execution at the node having breakpoint.
Step To CTRL+F10 Debug Debugs the procedure (see execution scopes). Executes from the beginning/current node and suspends the execution at the next selected node waiting until a debug command/key is clicked/pressed. If there is a breakpoint between the current point and the selected node, it suspends the execution at the node having breakpoint. If the selected node precedes the current point, it works the same as Debug button (F5) from the current point.
Step In F11 Debug Debugs the procedure (see execution scopes). Executes from the beginning/current node and suspends the execution at the adjacent node followed the current node waiting until a debug command/key is clicked/pressed. If the current point is a ProcedureCall, it steps into the called procedure and suspends the execution at the beginning node.
Step Out SHIFT+F11 Debug Debugs the procedure (see execution scopes). Steps out (executes all remaining nodes of) the called procedure from the current point and suspends at the corresponding ProcedureCall waiting until a debug command/key is clicked/pressed. It is only active if the execution is being suspended at a node in a called procedure.
Icons Note.png The debug command buttons and the debug shortcut keys only work if there is no execution is in progress or if a procedure is being executed with debugging and the execution is being suspended at a certain node.

Using Context Menu

Executing a procedure with the context menu is not affected by the execution scopes. To execute a certain procedure with context menu, you just need to right click on that procedure node in the Solution Explorer and select menu "Execute Workflow". The procedure shall be executed without debugging.


Modes of Execution

There are 2 modes of execution: the execution with debugging and the normal execution (without debugging).

Exclamation.png Important: Using an execution mode depends on the shortcut key or the command button which is used.

Execution with Debbuging

This mode allows you to observe the runtime behavior of your test sequence and locate logic errors. With this mode, you can suspend the execution at a certain node to examine your test sequences, evaluate and edit variables used in your test sequence through the Watch tool window. When the debugging suspends at a certain node, there shall be a yellow wrapping around the node, this helps you trace the debugging.

Normal Execution without Debugging

If you just want to execute the test sequence and get the results without examining its logic or tracing the variable changes, you can run with this mode. Running with this mode shall not be suspended at any nodes or breakpoints, excepts at the dialogs such as ConfirmDialog or modal screens.

Examples

Below are an example of a simple execution:

We have a simple test sequence of procedure main calling to the Procedure1.

OtfExecutionExImg1.PNG
procedure main
OtfExecutionExImg2.PNG
procedure Procedure1

Test01:

  • Run procedure main with Start button (CTRL+F5)
  • The execution is started and it suspendsExclamation.png at the ConfirmDialog (message="start"), click OK button, the execution finishes.

Test02:

  • Run procedure main with Debug button (F5).
  • The execution is started and it suspendsExclamation.png at the Assignment3 of the procedure Procedure1, this node has the breakpoint.
  • Click on the Debug button (F5) again.
  • The execution is started and it suspendsExclamation.png at the ConfirmDialog (message="start"), click OK button, the execution finishes.

Test03:

  • Add the Variable1 into the Watch tool window by right-clicking on the Variable1 in the solution Explorer or the Declaration Explorer tool window, and select the menu "Add to Watch window".
  • Select the ProcedureCall in the procedure main.
  • Run the procedure main with the Step To button (CTRL+F10).
  • The execution is started and it suspendsExclamation.png at the ProcedureCall.
  • Check the value of the Variable1 in the Watch tool window, the value is "start".
  • Double-click on the "Value" cell in the row of the Variable1 in the Watch tool window (or select the row and click on the "Change value" command), enter "CHANGED".
  • Click on the Step Over button (F10).
  • It can not step over to the ConfirmDialog activity because there is a breakpoint in the called procedure.
  • It suspendsExclamation.png at the Assignment3 of the procedure Procedure1, this node has the breakpoint.
  • Click on the Debug button (F5) again.
  • The execution is started and it suspendsExclamation.png at the ConfirmDialog (message="CHANGED"), click OK button, the execution finishes.