WinActor

2020.10.16
SampleScenarios WinActor Control
Resident sample scenario that monitors the deployment status of the scenario and executes the scenario

This section describes a resident sample scenario (hereinafter, this sample scenario) that monitors the placement of the scenario file (hereinafter, the command scenario file) in the folder and executes the command scenario file which has been placed.
*Please see this precautions upon downloading this sample scenario.

Feature

This sample scenario executes following process.

  • The specified folder is monitored, and when a file is placed in the folder, the placed file is used as the command scenario file to execute the scenario.
    * For the command scenario file you want to execute, you need to create a scenario to call this sample scenario at the end of the scenario.
  • Deletes the command scenario file to be executed.

WinActor(OR-5200) Modules to use

In this sample scenario, the following WinActor(OR-5200) modules are used.

  • 01_WinActor_Control* /02_ScenarioControl/GoToScenario.ums6
  • 07_StringOperation/01_Conversion_Formatting/Conversion_ReplaceString.ums6
  • 13_File/02_FileOperation/FileOperation_DeleteFile.ums6
  • 13_File/02_FileOperation/FileOperation_MoveFile.ums6
  • 13_File/04_FileList/FileList_GetFirstFile.ums6
  • 13_File/05_FileName/FileName_GetScenarioFilePath.ums6

* OR-5200 6.1 : 01_OR-5200_Control

Operating Environment

The operation of this sample scenario was confirmed in the following environment.

  • Windows 10
  • OR-5200 6.1.0, WinActor 7.1.1

Constraints

In the scenario used as the command scenario file, it is necessary to place "GoToScenario" at the end of the scenario and make a call to execute this sample scenario.

File structure

This section describes the files included in this sample scenario.

  1. "SampleCommands" folder
    In order to check the operation of this sample, a sample scenario file for commands is included. The explanation of the command scenario file included in the package is described below.
    • BrowserLaunch.ums6
      This is a command scenario file that open WEB pages with IE.
      After starting IE, it calls "GoToScenario" to return to the monitoring process of this sample scenario.
    • AlertDisplay.ums6
      This is a command scenario file that displays alerts.
      The following dialog will be displayed. Click the "OK" button.

      * After clicking the "OK" button, it calls "GoToScenario" to return to the monitoring process of this sample scenario. (It does not return to the monitoring process until it is clicked.)

      alert.png
      Alert

    • NotepadLaunch.ums6
      This is a command scenario file that starts Notepad.
      After starting Notepad, it calls "GoToScenario" to return to the monitoring process of this sample scenario.
    • CalculatorLaunch.ums6
      This is a command scenario file that starts the calculator.
      After starting the calculator, it calls "GoToScenario" to return to the monitoring process of this sample scenario.
  2. "order" folder
    This folder is the target for monitoring whether the command scenario file is located. When executing this sample scenario, copy the command scenario file under the "SampleCommands" folder into this folder.
    When the placement of the command scenario file is detected, the command scenario file is moved to the "current" folder and the command scenario file is executed. The folder at the time of provision is empty.

    * When changing the name of the folder, please also change the initial value of the variable "MonitoringFolderName" in this sample scenario.variableList1.png

    Variable list 1

  3. "current" folder
    This folder manages the command scenario file to be executed. This sample scenario moves the command scenario file to be executed from the "order" folder. This sample scenario deletes the command scenario file when the execution returns to this sample scenario from the execution of the command scenario file. The folder at the time of provision is empty.

    * When changing the name of the folder, please also change the initial value of the variable "ExecutionFolderName" in this sample scenario.variableList2.png

    Variable list 2

How to use

Create a scenario to be executed after waiting,

STEP1 Load this sample scenario


Extract the downloaded ZIP file. Load this sample scenario contained in the expanded folder with WinActor(OR-5200). For the expanded files, refer to File Structure.

STEP2 Copy the command scenario file to be executed (first time)

Copy the command scenario file under the "SampleCommans" folder to the "order" folder.
In the following Steps, if multiple command scenario files are placed under the "order" folder at the same time, the command scenario files at the beginning of the sort order defined by the OS will be processed first.

STEP3 Execute this sample scenario

WinActor(OR-5200) will start executing this sample scenario.
The command scenario file copied in Step 2 is executed. After all the copied command scenario files are executed, it enters into the monitor mode.

STEP4 Copy (add) the command scenario file to be executed

Copy the command scenario file under the "SampleCommands" folder to the "order" folder in the same way as in Step 2.
You can copy as many command scenario files as you like.
You can check the location of the command scenario file and confirm that the monitoring mode is changed to execution.
After all the copied command scenario files are executed, it enters into the monitor mode.

STEP5 End of this sample scenario

Since this sample scenario is a resident monitoring scenario, there is no clear termination function.
To end this sample scenario, click the "Stop" button yourself.

Trouble shooting

In this sample scenario, if you copy a file other than the scenario files under the "order" folder, an error message will be output.

See the error message list for more information.

Explanation

This section describes the implementation technique used in this sample scenario and an extension example of this sample scenario.

Scenario concept

First, the concept of this sample scenario will be described as follows.

This sample scenario monitors the placement of the scenario in the "order" folder.
When it is detected that the command scenario file has been placed, the command scenario file is moved to the "current" folder, and the corresponding command scenario file is executed in the library "01_WinActor_Control * / 02_ScenarioControl / GoToScenario.usm6".
The command scenario file to be executed continues to be monitored by restarting this sample scenario using the library "01_WinActor_Control * / 02_ScenarioControl / GoToScenario.usm6".
* OR-5200 v6.1 : 01_OR-5200_Control

Pre-delete the command scenario file to be executed

First, delete the files that exist under the "current" folder. The "13_File / 02_FileOperation / FileOperation_MoveFile.ums6" library to be used later cannot be overwritten.

By deleting the command scenario file in advance, the same command scenario file can be used.

Infinite loop processing to make it a resident scenario

This sample scenario makes the "Node / Flow / Repeat" condition an infinite loop. It repeats the loop until the command scenario file is placed in the "order" folder. When the placement of the command scenario file is detected, it moves the command scenario file to the "current" folder and executes the command scenario file using "01_WinActor_Control / 02_ScenarioControl / GoToScenario.usm6".

You can get out of the infinite loop by executing the command scenario file. That is, this sample scenario ends.
Resident monitoring is enabled by executing this sample scenario using "01_WinActor_Control / 02_ScenarioControl / GoToScenario.usm6" even in the command scenario file to be executed.

Conditional.png
Conditional expression

Measures required in an environment where copying the command scenario file takes time

In an environment where it takes time to copy the command scenario file under the "order" folder, "GoToScenario" may be executed before the file copy is completed. Since it is read in the state of an incomplete scenario file, the error "Failed to read the scenario file" occurs as a result. In such an environment, it is necessary to add a process to confirm that the file copy is completed between "Get first file" and "Move file", which is the pre-process of calling "GoToScenario".

Strict processing order when multiple files are placed in the monitored folder

In the library "13_File / 04_FileList / FileList_GetFirstFile.ums6", the list of files in the folder is acquired using the Shell.Application object.

At that time, it is expected that the file name list can be obtained implicitly in ascending order of file names, but the specifications for the sort order have not been clarified.
If you want to tighten the processing order, you need to modify the script itself of the library "13_File / 04_FileList / FileList_GetFirstFile.ums6".

Track changes

VersionDateDetails
1.0 10/08/2020 First edition