Login PI Workload Meta Language

From Login VSI Documentation
Jump to: navigation, search

Functions

This section describes every function used within the Login PI workload meta language.

Note: If any parameter included within the Syntax is book-ended by these brackets [ ], then this parameter is optional.

App_Close

This function closes an application or window.

Syntax

App_Close("Logname", "Searchmode", "Searchstring", [“SearchContent”])

Parameters

Logname

String

Searchmode

Selection

Title, Class

Searchstring

String

[SearchContent]

String

Code Example

App_Close("MyLogName", "Title", "Notepad", "Text in document or app")

Related Functions

App_Start, App_Focus

App_Focus

This function makes sure an application window is on top but can also be used to minimize or maximize an application.

Note: If an application window is already on top it will be ignored.

Syntax

App_Focus("Logname", "Searchmode", "Searchstring", ["SearchContent"], ["Action"])

Parameters

Logname

String

Searchmode

Selection

Title, Class

Searchstring

String

[SearchContent]

String

[Action]

Selection

Maximize, Minimize

Code Example

App_Focus("MyLogName", "Title", "Notepad", "Text in document or app", "Maximize")

Related Functions

App_Start, App_Close

App_Start

The App_Start function can start applications and open documents by leveraging the shell execute capabilities of the operating system. When you want to start an application, it’s recommended to use the file type association. This way a document will automatically be opened and application virtualization techniques are supported out of the box.

Syntax

App_Start("Logname ", "Working directory", "Executable or full path", "Window search mode", "Window title", ["Window content"], ["Command line parameters"])

Parameters

Logname

String

Working directory

String

Executable or full path

String

Windows Search mode

Selection

Title, Class

Window title

String

[Window Content]

String

[Command line parameters]

String

Code Example

App_Start("Logname", "c:\windows\system32", "notepad.exe", "Title", "Notepad", "Some text found in the document or app", "H:\document.txt")

Related Functions

App_Close, App_Focus

Timer_Start

Start a timer with the result added as a workload action result.

Syntax

Timer_Start("Logname")

Parameters

Logname

String

Code Example

Timer_Start("SAP Logon")

Related Functions

Timer_Stop

Timer_Stop

Stop a timer with the result added as a workload action result.

Syntax

Timer_Stop("Logname")

Parameters

Logname

String

Code Example

Timer_Stop("SAP Logon")

Related Functions

Timer_Start

VSI_Mouse_Click

This function allows the implementation of mouse clicks into a workload.

Syntax

VSI_Mouse_Click("Logname", "MouseButton", X Position, Y Position, NumberOfClicks)

Parameters

Logname

String

MouseButton

String

Left or Right click; Left is default

X

Integer

Position of the mouse (if not filled it will take current position)

Y

Integer

Position of the mouse (if not filled it will take current position)

NumberOfClicks

Integer

Code Example

VSI_Mouse_Click("Workload", "left", 50, 100, 2)

Related Functions

VSI_Mouse_Position

VSI_Mouse_Position

Moves the mouse to a configured position during the workload to make sure it will not interfere with the focus.

Syntax

VSI_Mouse_Position("Logname ", X-Axis, Y-Axis)

Parameters

Logname

String

X-Axis

Integer

Mouse position on the X-axis

Y-Axis

Integer

Mouse position on the Y-axis

Code Example

VSI_Mouse_Position("Logname", 30, 30)

Related Functions

VSI_Mouse_Click

VSI_Random_File_Copy

Copy a random file from the file library to specified target location.

Syntax

VSI_Random_File_Copy("logname","Filetype","Target")

Parameters

Logname

String

Filetype

String

Target

String

Code Example

VSI_Random_File_Copy("logname","doc","h:\document.doc")

Related Functions

n/a

VSI_RegDelete

Delete a registry value, such as string, binary, DWORD (32-bit), QWORD (64-bit), multi-string and expandable string.

Syntax

VSI_Regdelete("Logname","KeyName",["ValueName"])

Parameters

Logname

String

KeyName

String

[ValueName]

String

Code Example

VSI_RegDelete("AppName","HKEY_CURRENT_USER\Software","VSI")

Related Functions

VSI_RegWrite

VSI_RegWrite

Write a registry value, such as string, binary, DWORD (32-bit), QWORD (64-bit), multi-string and expandable string.

Syntax

VSI_RegWrite("Logname","KeyName","ValueName","Type")

Parameters

Logname

String

KeyName

String

ValueName

String

Type

Selection

"REG_SZ", "REG_MULTI_SZ", "REG_EXPAND_SZ", "REG_DWORD", "REG_QWORD", "REG_BINARY"

Code Example

VSI_RegWrite("Appname","HKEY_CURRENT_USER\Software","VSI","REG_SZ","VSI40TEST")

Related Functions

VSI_RegDelete

VSI_Save

Sends the save file key sequence and checks if the file time-stamp is updated.

Syntax

VSI_Save("Application", "Savecommand", "Savelocation")

Parameters

Application

String

Savecommand

String

Savelocation

String

Code Example

VSI_Save("Word", "{ctrldown}s{ctrlup}", "C:\UserEdit.doc")

Related Functions

None

VSI_ShellExecute

Perform a shell execute action.

Syntax

VSI_ShellExecute("Logname", "filename", "parameters", "workingdir", "verb", "showflag")

Parameters

Logname

String

Filename

String

Parameters

String

Workingdir

String

Verb

String

Showflag

Selection

Maximize, Minimize

Code Example

VSI_ShellExecute("MyApp", "c:\temp\document.txt", "", "", "", “Maximize”)

Related Functions

VSI_ShellExecuteWait

VSI_ShellExecuteWait

Perform a shell execute action and wait for the command to finish before continuing the workload.

Note: If the action never finishes then the workload will pause forever.

Syntax

VSI_ShellExecuteWait("Logname", "filename", "parameters" , "workingdir" ,"verb", “showflag”)

Parameters

Logname

String

Filename

String

Parameters

String

Workingdir

String

Verb

String

Showflag

Selection

Maximize, Minimize

Code Example

VSI_ShellExecuteWait("MyApp", "%VSI_Share%\MyCustomApp.exe", "", "", "", “Maximize”)

Related Functions

VSI_ShellExecute

VSI_Sleep

Wait for specified number of seconds before continuing the next action.

Syntax

VSI_Sleep(Time)

Parameters

Time

Integer

Code Example

VSI_Sleep(30)

Related Functions

Workload_Idle

VSI_Type

Type the defined text.

Syntax

VSI_Type("Application", "Text")

Parameters

Application

String

Text

String

Code Example

VSI_Type("Word", "Text to type")

Related Functions

None

Workload_Idle

Wait for a specified number of milliseconds before continuing the next action and allows the user to specify a message that will be shown on screen during the idle time.

Syntax

Workload_Idle(“Logname”, Time, "Message")

Parameters

Logname

String

Time

Integer

In seconds

Message

String

Code Example

Workload_IDLE(“Workload”, 30, “%USERNAME% is IDLE”)

Related Functions

VSI_Sleep

Login PI Key Commands

For several commands that are used in the Login PI workloads, keystrokes can be sent to the VM. The keys that are supported and used within the workloads are described below.

Note: You can have certain keystrokes sent multiple times by inserting a numeric value after the command:

  • {TAB 10} = sending tab 10 times

Workload Command

Result

{!}

'!'

{#}

'#'

{+}

+

{^}

Ctrl Key

{{}

{

{}}

}

a-z

A-Z Keys

{SPACE}

Space

{ENTER}

Enter Key

{ALT}

ALT

{BACKSPACE} or {BS}

Backspace

{DELETE} or {DEL}

Delete

{UP}

Up Arrow

{DOWN}

Down Arrow

{LEFT}

Left Arrow

{RIGHT}

Right Arrow

{HOME}

Home

{END}

End

{ESCAPE} or {ESC}

Escape

{INSERT} or {INS}

Insert

{PGUP}

Page Up

{PGDN}

Page Down

{F1} - {F12}

Function Keys

{TAB}

Tab

{PRINTSCREEN}

Print Screen

{LWIN}

Left Windows Key

{RWIN}

Right Windows Key

{NUMLOCK on}

Toggle NumLock (on/off/toggle)

{CAPSLOCK off}

Toggle Caps Lock (on/off/toggle)

{SCROLLOCK toggle}

Toggle Scroll Lock (on/off/toggle)

{BREAK}

for Ctrl+Break processing

{PAUSE}

Pause

{NUMPAD0} - {NUMPAD9}

Numpad Digits

{NUMPADMULT}

Numpad Multiply

{NUMPADADD}

Numpad Add

{NUMPADSUB}

Numpad Subtract

{NUMPADDIV}

Numpad Divide

{NUMPADDOT}

Numpad Period

{NUMPADENTER}

Numpad Enter

{APPSKEY}

Windows App Key

{LALT}

Left Alt

{RALT}

Right Alt

{LCTRL}

Left Ctrl

{RCTRL}

Right Ctrl

{LSHIFT}

Left Shift

{RSHIFT}

Right Shift

{SLEEP}

Computer Sleep Key

{ALTDOWN}

Hold Alt down until {ALTUP} is sent

{SHIFTDOWN}

Hold Shift down until {SHIFTUP} is sent

{CTRLDOWN}

Hold Ctrl down until {CTRLUP} is sent

{LWINDOWN}

Holds left Windows Key down until {LWINUP} is sent

{RWINDOWN}

Holds right Windows Key down until {RWINUP} is sent