VBScript/en

From expecco Wiki (Version 2.x)
Jump to navigation Jump to search

Introduction[edit]

VBScript-Code in expecco

This plugin allows for Visual Basic Script (VBScript) actions to be created, imported and executed in expecco. For import and execution, the plugin uses the Windows executable "ScriptClient.exe", which is part of the expecco VBScript plugin package and technically addressed via the .NET-Bridge.

Settings[edit]

The settings contains the path of the ScriptClient program. By default, this is:

  plugin\vbScript\ScriptClient\ScriptClient.exe


In addition, you can define a so called "scope", which makes importing of scripts easier. If set, only that part of the file system will be shown in the import window.

The checkbox "Delete External Files" tells if scripts can be removed from the file system after being imported. This is mostly useful if scripts are coming from a generator or from an export mechanism of another program (e.g. SAP).

Working with VBScript[edit]

The following describes typical interactions with the plugin. The plugin's menu is found under "Extensions" → "Bridges" → "VBScript".

Connecting[edit]

Before a script can be imported or executed, expecco needs to be connected to a ScriptClient. The "connect"-option is found in the menu.

The ScriptClient can run either on the local or on a remote machine. Because it is a proprietary Windows program, it must run on either a Windows machine, a virtual machine running Windows or in an emulator, such as Wine. The connection is done via a .NET-bridge; therefore, expecco itself can run on any system (incl. Linux or OSX).

In case of a local connection, the ScriptClient will be automatically started by expecco.

For a remote connection, the ScriptClient must be already running and started either manually, or via a script or autoexec.bat. Command-line arguments for the startup are described in the following table:

Argument Description
-port <int> The TCP-port to be used for the connection.
-mode <server/client> Run the .NET-bridge either as TCP-server or TCP-client.
-keepAlive <true/false> true if the ScriptClient should continue to run after a connection breakdown.

Importing[edit]

Import-Dialog

Open the import-dialog via the plugin's menu (found in the "Extensions" menu). It presents folders and VBS-files (*.vbs) of the Host, on which the ScriptClient is running.

The source code of a selected script is shown in a preview window. The script can be imported or executed via the context menu (right-click on a script file), or via the buttons in the preview window.

Editing Scripts[edit]

When a VBScript action block is imported or created (or copy-pasted), an action item is added to the active test suite. Assigned values in the script will be mapped to input pins, by which the action can later be parametrised without a need to change the script's code.

In addition, an output pin is created, which will deliver whatever the script will send to the console.

Like any other elementary action block, the script's code can be edited later via the "Code" tab. Input pin values are treated like environment variables inside the script - their names have to be surrounded by '%'-characters in the script.

Executing[edit]

When executed, a VBScript-block behaves like any other action block in expecco. Of course, a ScriptClient needs to be present (and in case of remote execution already running). Obviously, the ScriptClient must run on a Windows machine (or inside a virtual guest machine, running Windows).



Copyright © 2014-2018 eXept Software AG