VBScript/en: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) |
Cg (Diskussion | Beiträge) |
||
Zeile 43: | Zeile 43: | ||
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. |
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== |
==Editing Scripts== |
||
When a VBScript action is imported or created, 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. |
|||
Wurde ein Skript importiert oder neu angelegt, wird es in der aktiven Testsuite abgelegt. Zuweisungen im Skript werden als Eingänge im entstandenen Block angelegt. Die durch das Skript abgebildete Aktion kann somit parametrisiert werden ohne in das Skript selbt eingreifen zu müssen. |
|||
In addition, an output pin is created, which will deliver whatever the script will send to the console. |
|||
Des weiteren verfügt der Block über einen Ausgang der den Wert zurück liefert, welchen das Skript an die Konsole zurückliefern würde. |
|||
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. |
|||
Über den Tab "''Quellcode''" kann das Skript nachbearbeitet werden. Eingangspins werden im Skript wie Umgebundvariablen behandelt, der Name muss also im Script in %-Zeichen gesetzt werden. |
|||
==Executing== |
==Executing== |
Version vom 8. Dezember 2016, 09:47 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]
Über das Menü des Plugins kann der Importdialog geöffnet werden. Angezeigt werden Ordner und VBS-Dateien (*.vbs) des Rechners auf dem der verbundene ScriptClient läuft.
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[Bearbeiten]
When a VBScript action is imported or created, 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).