VBScript/en: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) |
Cg (Diskussion | Beiträge) |
||
Zeile 39: | Zeile 39: | ||
==Importing== |
==Importing== |
||
[[Bild:VBScript_Import.png|thumb|220px|Import-Dialog]] |
[[Bild:VBScript_Import.png|thumb|220px|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. |
|||
Der Sourcecode angewählter Skripte wird im Vorschaufenster angezeigt und kann über das Kontextmenü des Baums (Rechtsklick auf ein Scriptfile) oder die Buttons im Vorschaufenster importiert und ausgeführt werden. |
|||
==Editing Scripts== |
==Editing Scripts== |
Version vom 8. Dezember 2016, 09:51 Uhr
Inhaltsverzeichnis
Introduction[Bearbeiten]
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 "ScriptClient", which is addressed via the .NET-Bridge.
Settings[Bearbeiten]
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 inported. This is mostly useful if scripts are coming from a generator or from an export mechanism of another program (i.e. SAP).
Working with VBScript[Bearbeiten]
Im folgenden wird die Interaktion mit dem Plugin anhand üblicher Arbeitsabläufe näher beschrieben. Das Menü des Plugins ist unter "Erweiterungen" -> "VBScript" zu finden.
Connecting[Bearbeiten]
Bevor 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. gestartet.
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[Bearbeiten]
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[Bearbeiten]
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. Inputpin values are treated like environment variables inside the script - their names have to be surrounded by '%'-characters in the script.
Executing[Bearbeiten]
Beim Abspielen verhält sich ein VBScript-Block wie jeder andere Block in expecco. Es muss natürlich ein ScriptClient vorhanden sein, bzw. im Remote-Fall bereits gestartet sein. Selbstverständlich ist, daß der ScripClient auf einem Windows Rechner laufen muß (bzw. in einer virtuellen Windows Gastmaschine).