Blog: 5 Best Practices for VDI Workload Customization with Login VSI
Login VSI Workload Language Reference Guide
Concept
The default workloads shipped with Login VSI 4.1.x are designed to stress and performance test a system in a realistic way not only during the project phase of a VDI or SBC implementation, but also to safeguard and improve the performance in an existing environment. To do this a few design choices have been made, it’s not mandatory to obey these design decisions, but it is strongly recommended when building workloads from scratch or extending/changing a large part of them.
- A workload must have a prepare phase/segment
- A workload should take 48 minutes
- A 48-minute workload should be divided into 4 segments
- Every segment should end with a 2-minute idle buffer
- As the workload slows down because of degradation of performance, the buffer will be smaller to keep the segments 12 minutes in time
- Segments reflect user activities, for example the Knowledge workload consists of a segment that does:
- Multimedia & relaxation
- Productivity
- Consuming information (reading PDFs, Word docs, etc.)
- Every segment contains 3 timers
- When a timer is initiated, no other instance of Microsoft Word is running
- Workloads should be compatible with all MS operating systems (Windows 7 and higher)
- Available in both 32-bit and 64-bit versions
- Workloads should be compatible with all MS Office versions (2007 and higher)
- Workloads should be able to run continuously (in loops)
- Make sure the documents that are created are being cleaned up
- Make sure all applications are closed at the end of a workload
- Applications should be started using a document and their file type association (when possible)
- The first timer executed by a user will be ignored
When testing the segment and loop length of your newly created workload(s), it is recommended to use a machine with at least 2(v)CPUs and 1GB of memory, as that is the industry standard for VDI environments.
Tips for creating a custom workload
- First create a step-by-step procedure of what you would like the workload to do. This is very helpful for referencing purposes when creating your workload.
- If possible try to use only keyboard commands. You can do exact mouse movements, however you are going to run into issues if the target machine application window is off even by a pixel, so using keyboard commands is highly recommended.
- If you do need to use mouse movements, make sure you run your application in "Windows mode" and make sure the resolution for your launcher and target machines are the same.
- Try using tabs (multiple) instead of mousing over something.
- Look at our built-in workloads, Officeworker, Taskworker, etc., to see how we created them and grab commands you can use in your workload. See this section on Workload Customization.
- Since you will be running a lot of tests while building your custom workload, just use one launcher initially and test against one target machine. Also change the Launch Window to something like 100 while testing. The idea is to quickly launch the test to see your results, then fix any issues and continue adjusting the workload.
- Read the Login VSI Knowledge Base articles on customizing workloads.
Note: When including a parameter that contains spaces within a workload function, you must place it between quotation marks, e.g. "this is a test".
Language options
Login VSI Workloads can be designed so that they work on operating systems and applications that are multi-language. Before execution, the engine will parse the workload in the language configured for the test. It will replace everything between the lang: .. :lang tags. For example, lang:Outlook:lang will result in "Inbox" when English is selected, but it will return "Postvak" when Dutch is selected as the language in the MMC.
Login VSI uses a dictionary file to provide the engine with the replacements needed for every specific language the workload has to support. The dictionary file can be found in the following folder within the VSIshare:_VSI_Configuration\_CurrentTest\LanguageSettings.csv.
Example: LanguageSettings.csv:
ID |
English |
Dutch |
Japanese |
|
|
Afdrukken |
印刷 |
ExelGoto |
Go To |
Ga Naar |
ジャンプ |
The language file can be extended up to 200 languages (columns) and a virtually unlimited amount of items (rows).
Predefined variables
The Login VSI Workloads support the use of predefined variables. These variables make the workloads easier to use on different platforms and by different users as values are automatically updated to reflect the current environment.
Replacements supported by the Login VSI 4.1.x Engine relevant for the meta language:
Variable |
Description |
Standard Windows Environment Variables |
%APPDATA%, %USERNAME%, etc. See http://ss64.com/nt/syntax-variables.html. |
%VSI_ActiveTest% |
The name of the active test. |
%VSI_DataLocation% |
The path to the content share used by this user. |
%VSI_GroupDrive% |
The path to the VSI group drive. |
%VSI_HomeDrive% |
The path to the VSI home drive. |
%VSI_Office_Version% |
The Microsoft Office version number. |
%VSI_Random_doc% |
A random Microsoft Word (.doc) document chosen from the content pool. |
%VSI_Random_docx% |
A random Microsoft Word (.docx) document chosen from the content pool. |
%VSI_Random_jpg% |
A random Jpeg file chosen from the content pool. |
%VSI_Random_mm% |
A random FreeMind MindMap document chosen from the content pool. |
%VSI_Random_pdf% |
A random PDF file chosen from the content pool. |
%VSI_Random_ppt% |
A random Microsoft PowerPoint (.ppt) presentation chosen from the content pool. |
%VSI_Random_pptx% |
A random Microsoft PowerPoint (.pptx) presentation chosen from the content pool. |
%VSI_Random_pst% |
A random PST file chosen from the content pool. |
%VSI_Random_Recipient% |
A random email recipient chosen from a predetermined pool. The predetermined pool cannot be changed. |
%VSI_Random_txt% |
A random TXT file chosen from the content pool. |
%VSI_Random_xlsx% |
A random Microsoft Excel (.xslx) worksheet chosen from the content pool. |
%VSI_Share% |
The path to the VSIshare. |
%VSI_UserHome% |
The path to the default VSI user folder (H: drive). |
%VSI_WebLocation% |
The path to the websites used by this user. |
%VSI_Web_BBC% |
The number of versions available for the BBC website in the web content pool. |
%VSI_Web_Engadget% |
The number of versions available for the Engadget website in the web content pool. |
%VSI_Web_Pinterest% |
The number of versions available for the Pinterest website in the web content pool. |
%VSI_Web_Player% |
The number of versions available for the video content in the web content pool. Please note that VSI does not currently distinguish between the different formats, i.e. 480p, 720p, 1080p. |
%VSI_Web_TheVerge% |
The number of versions available for the Verge website in the web content pool. |
%VSI_Web_Wired% |
The number of versions available for the Wired website in the web content pool. |
%VSI_Workload_Language% |
The language chosen for the workload. |
Code Example
This code example shows how variables can be used to open a document with a variable name:
App_Start("PhotoViewer", "%TEMP%\VSI\RunTime\Lib", "VSIPictureViewer.exe", "Title", "VSI Picture Viewer", "", "%VSI_GroupDrive%\jpg\%VSI_Random_jpg%")
Adding an application to a workload
If you are thinking about extending the workload with an extra application, please follow these steps to add it to the workload. In this example, you can see how to add a simple application to the workload, load a document, read and manipulate it, and then close the document.
#Open a document. The default FileType Association (FTA) will open it in the application associated with that file type. # Wait for the window to appear and make sure it is maximized # Edit the newly opened document # Save the newly created document # Close the saved document |
Below is an example of adding an application to the workload without using file type association.
# Open new instance of Chrome and browse to gmail. # Wait for the window to appear and make sure it is maximized # Browse messages in Gmail # Wait for the actual email to be loaded. Please note that this mailbox was prepared to have only emails starting VSIMAIL. # Move back to inbox # Close Chrome |
Removing an application from the workload
If you want to remove an application that is part of one of our default workloads, simply follow the steps below to remove it:
- Note the logname of the application you want to remove, the logname is always the first parameter of every function in the workload language, e.g. Outlook
- Identify all lines that contain this logname and remove them
- Save the workload
- Run a test
Functions
This section will describe every function within the Login VSI 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 be opened automatically with application virtualization techniques 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
PDF_Print
Will start a print action for the currently active window and generate a PDF file using DoroPDF writer. When the term 'Office' is used in the Logname, the print sequence will automatically be adapted to the correct version of MS Office.
Syntax
Normal:
PDF_Print("PDFWriter", "PDF Printer Windowname", ["Filename"]) |
From a Microsoft Office application:
PDF_Print("PDFWriterOffice", "PDF Printer Windowname", ["Filename"]) |
Parameters
PDF Printer Windowname |
String |
"Doro PDF Writer" |
Do not use a different printer window name. This parameter is in preparation for supporting other PDF printers. |
Filename |
String |
Optional |
Prints to the specified file name. If this parameter is not specified it will default to "%VSI_UserHome%\Output\PDFPrint.pdf". |
Code Example
PDF_Print("PDFWriter", "Doro PDF Writer", "%VSI_Userhome%\Output\PWP1Print.pdf") |
Related Functions
App_Focus
Segment
Will add a segment to the workload. A typical segment is 12 minutes in length of which 10 minutes are active and 2 minutes are idle. Users initiating their Login VSI test will automatically be assigned the segment they start in, in order to load balance application usage.
Syntax
Segment("Logname",Segment ID) |
Parameters
Logname |
String |
|
Segment ID |
Integer |
Cannot be 0 |
Code Example
Segment("Workload",1) |
Related Functions
VSI_Buffer
Set_DefaultPrinter
This function can be used to change the default printer within a test session.
Syntax
Set_DefaultPrinter("LogName", "Printername") |
Parameters
Logname |
String |
Printername |
String |
Code Example
Set_DefaultPrinter("LogName", "DoroPDF Writer") |
Related Functions
PDF_Print
VSI_7Zip
Creates an 7-Zip archive <target> of a given <source> with a given <compression> and a password of <password> characters.
Syntax
VSI_7Zip("Logname", "Source", "Target", "Compression", "Password") |
Parameters
Logname |
String |
|
Source |
String |
The source to create the archive from |
Target |
String |
The full path to the target |
Compression |
String |
The level of compression, sets the -mx param of 7-Zip |
Password |
Integer |
Number of password characters (0 = no password) |
Code Example
VSI_7Zip("Logname", "c:\test", "test.zip", 0, 3, false) |
Related Functions
VSI_7ZipExtract
VSI_7ZipExtract
Extracts a 7-Zip archive <target> of a given <source> and a password of <password> characters.
Syntax
VSI_7ZipExtract("Logname", "Source", "Target") |
Parameters
Logname |
String |
|
Source |
String |
The source to the compressed file |
Target |
String |
The full path to the target |
Code Example
VSI_7ZipExtract("Logname", "c:\test\test.zip", "C:\test") |
Related Functions
VSI_7Zip
VSI_AppFocusImage
Performs an image comparison. Starting at the top left of the image and moving pixel by pixel. Once the image is located, a click is sent. If it's not found, it will log to the workload debug log.
Syntax
VSI_AppFocusImage("MyImageFile", [Timeout], [Tolerance]) |
Parameters
MyImageFile |
String |
The location of the image to locate |
[Timeout] |
Integer |
The amount of time before the search fails |
[Tolerance] |
Integer |
If the RGB image value for a pixel in the file is 50 and the found pixel is 55 and tolerance is set to 5 then it will match. This helps with different image quality settings. Example - 32 vs 16 bit colors. |
Code Example
VSI_AppFocusImage("\\server\VSIShare\Images\Image.JPG", 30, 2) |
Related Functions
none
VSI_Browse
Browses 'scrolls' through the current active window, like a real user would.
Syntax
VSI_Browse("LogName", Time, Maxdown, AmountDown, UpAmount, ReadInterval, DownInterval, UpInterval, Direction) |
Parameters
Logname |
String |
||
Time |
Integer |
Time in seconds to scroll through the currently active window. |
|
MaxDown |
Integer |
How many times the down key can be pressed before the end of the document is reached. |
|
AmountDown |
Integer |
How many times the down key should be pressed per scroll operation. |
|
UpAmount |
Integer |
How many times the up key should be pressed per scroll operation. |
|
ReaderInterval |
Integer |
How long to pause between scroll operations. |
|
DownInterval |
Integer |
How much time in milliseconds between down keystrokes. |
|
UpInterval |
Integer |
How much time in milliseconds between up keystrokes. |
|
Direction |
Selection |
1, 2, 3, 4 |
1=Up/Down, 2=Right/Left, 3=Down/Up, 4=Left/Right |
Code Example
VSI_Browse("Internet", 120, 90, 8, 4, 3000, 500, 500, 1) |
Related Functions
VSI_Type_Fixed, VSI_Type_Time
VSI_Buffer
As it’s recommended to make segments 10 minutes long with a 2 minute idle, this function can make sure that if a segment is too short or executed too slowly, it is stretched or shortened to fit back into the 12 minute timeframe. The engine automatically monitors this timeframe and adjusts it accordingly. The goal of this buffer is to smooth out the test results and allow for easier analysis of the data.
Syntax
VSI_Buffer("Logname",Minimum wait) |
Parameters
Logname |
String |
|
Minimum wait |
Integer |
Minimum idle time in seconds if the segment has executed too slowly (default = 30). |
Code Example
VSI_Buffer("Workload",30) |
Related Functions
Segment
VSI_ControlCommand
Sends a command to a control. Does not return a value. For more information about this command please click here.
Syntax
VSI_ControlCommand("Title", "Text", "ControlId", "Command", ["Option"]) |
Parameters
Title |
String |
Text |
String |
ControlID |
String |
Command |
String |
Option |
String |
Code Example
VSI_ControlCommand("[CLASS:Notepad]", "", "Edit1", "GetLineCount", "") |
Related Functions
VSI_ControlSend, VSI_ControlFocus
VSI_ControlFocus
Sets input focus to a given control on a window.
Syntax
VSI_ControlFocus("Title", "Text", "ControlId") |
Parameters
Title |
String |
Text |
String |
ControlID |
String |
Code Example
VSI_ControlFocus("[CLASS:Notepad]", "", "Edit1") |
Related Functions
VSI_ControlCommand, VSI_ControlSend
VSI_ControlSend
Sends a string of characters to a control.
Syntax
VSI_ControlSend ("Title", "Text", "ControlId", "String") |
Parameters
Title |
String |
Text |
String |
ControlID |
String |
String |
String |
Code Example
VSI_ControlSend("[CLASS:Notepad]", "", "Edit1", "This is a line of text in the notepad window") |
Related Functions
VSI_ControlCommand, VSI_ControlFocus
VSI_CopyRandom
Recursively scans a directory for files and copies <$NumberOfFiles> random files.
Syntax
VSI_CopyRandom("Logname", Source", "Target", Amount) |
Parameters
Logname |
String |
|
Source |
String |
Directory to scan for a file |
Target |
String |
Directory to copy to |
Amount |
Integer |
Amount of files to copy |
Code Example
VSI_CopyRandom("Logname", %VSIShare%\_VSI_Content","%TMP%\VSI\RandomCopy", 20) |
Related Functions
VSI_Dir_Copy_Wait
VSI_CustomTimer
This function allows a user to create custom timer actions. For example, if you want to find out how long it takes to open a specific file in MS Word, with this function you can start the timer. This command works in combination with the CustomTimerStop function.
Syntax
VSI_CustomTimer("Logname") |
Parameters
Logname |
String |
Code Example
VSI_CustomTimer("Word_Document_start") |
Related Functions
VSI_CustomTimerStop
VSI_CustomTimerStop
This command is used in combination with the CustomTimer function. It is used to stop the custom timer action. The second parameter "Category" will be used as the tab name in the Login VSI Analyzer.
Syntax
VSI_CustomTimerStop("Logname", "Category") |
Parameters
Logname |
String |
Category |
String |
Code Example
VSI_CustomTimerStop("Word_Document_start", "Word_File_Start") |
Related Functions
VSI_CustomTimer
VSI_DirDelete
Deletes directory recursively.
Syntax
VSI_DirDelete("Logname", "Path to dir") |
Parameters
Logname |
String |
Path to dir |
String |
Code Example
VSI_DirDelete("Logname", "c:\test\") |
Related Functions
VSI_Dir_Copy_Wait
Copies a directory and waits for it to complete.
Syntax
VSI_Dir_Copy_Wait("Source", "Target") |
Parameters
Source |
String |
Directory to copy |
Target |
String |
Directory to copy to |
Code Example
VSI_Dir_Copy_Wait(%VSIShare%\_VSI_Content","%TMP%") |
Related Functions
VSI_CopyRandom
VSI_DriveMap
Maps a network drive to a drive letter.
Syntax
VSI_Drivemap("logname","Drive","Remote share") |
Parameters
Logname |
String |
Drive |
String |
Remote share |
String |
Code Example
VSI_Drivemap("logname","X:","\\server\share") |
Note: If you use "*" as a drive letter, the first unused drive will be used.
Related Functions
none
VSI_FileWriteToLine
Write text to a file.
Syntax
VSI_FileWriteToLine("Logname", "Filename / location", "Line number", "Text") |
Parameters
Logname |
String |
Filename / location |
String |
Line Number |
Integer |
Text |
String |
Code Example
VSI_FileWriteToLine("Logname", "c:\temp\example.txt", 1, "Hello world") |
Related Functions
None
VSI_File_Copy
Copies a file from source to target.
Syntax
VSI_File_Copy("logname","Source","Target") |
Parameters
Logname |
String |
Source |
String |
Target |
String |
Code Example
VSI_File_Copy("logname","c:\temp\document.doc","c:\temp\document2.doc") |
Related Functions
VSI_File_Delete, VSI_Random_File_Copy
VSI_File_Delete
Deletes the specified file.
Syntax
VSI_File_Delete("logname","FilePath") |
Parameters
Logname |
String |
FilePath |
String |
Code Example
VSI_File_Delete("logname","c:\temp\document.doc") |
Related Functions
VSI_File_Copy
VSI_Logoff
Forces the session to log off and sends a report to the Management Console confirming that the session has been logged off.
Syntax
VSI_Logoff(Enabled or Disabled) |
Parameters
Enable VSI_Timer() |
0 or 1 |
When disabled (0) no VSI_Timer will be run |
Code Example
VSI_Logoff(0) |
Related Functions
VSI_LogoffNoPrint()
VSI_LogoffNoPrint
Forces the session to log off without the timer, but does not send a report to the Management Console confirming that the session has logged off.
Syntax
VSI_LogoffNoPrint(Enabled or Disabled) |
Parameters
Enable VSI_Timer() |
0 or 1 |
When disabled (0) no VSI_TimerNoPrint will be run |
Code Example
VSI_LogoffNoPrint(0) |
Related Functions
VSI_Logoff()
VSI_LogOpenWindowTitles
Will log all open window titles to the workload debug log.
Syntax
VSI_LogOpenWindowTitles() |
Code Example
VSI_LogOpenWindowTitles() |
Related Functions
none
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
none
VSI_Mouse_Position
Moves the mouse to a configured position. This is to make sure the mouse will not interfere with the focus during the workload.
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_Random_File_Copy
Copies a random file from the file library to a specified location.
Syntax
VSI_Random_File_Copy("logname","Filetype","Target", [Exclude]) |
Parameters
Logname |
String |
|
Filetype |
String |
|
Target |
String |
|
Exclude |
0 or 1 |
Optional |
Note: The exclude parameter indicates that this statement should not be included during the startup segment.
Code Example
VSI_Random_File_Copy("logname","doc","h:\document.doc", 1) |
Related Functions
VSI_File_Delete, VSI_File_Copy
VSI_Read2
This function browses 'scrolls' through the currently active window, like a real user (used in the 4.1 workloads).
Syntax
VSI_Read2("Logname", Time, DownAmount, UpAmount, ReadInterval, DownInterval, UpInterval, Direction, BottomPageAmount) |
Parameters
Logname |
String |
||
Time |
Integer |
Seconds |
Amount of time taken to scroll down through the current active window |
DownAmount |
Integer |
How many times the down key should be pressed per scroll operation |
|
UpAmount |
Integer |
How many times the up key should be pressed per scroll operation |
|
ReaderInterval |
Integer |
Milliseconds |
How long to pause between scroll operations |
DownInterval |
Integer |
Milliseconds |
Amount of time between down keystrokes |
UpInterval |
Integer |
Milliseconds |
Amount of time between up keystrokes |
Direction |
Selection |
1, 2, 3, 4 |
1=Up/Down, 2=Right/Left, 3=Down/Up, 4=Left/Right |
BottemPageAmount |
Integer |
How many times the down key can be pressed before the end of the document is reached |
Code Example
VSI_Read2("Internet", 120, 90, 80, 4000, 3000, 500, 1, 120) |
Related Functions
VSI_Type_Fixed, VSI_Type_Time, VSI_Browse
VSI_RegDelete
Delete a registry value.
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_Reg_Write
VSI_RegImport
Imports external registry files.
Syntax
VSI_RegImport("Logname", "Registry file") |
Parameters
Logname |
String |
Registry File |
String |
Code Example
VSI_RegImport("Logname", "%tmp%\VSI\Runtime\example.reg") |
Related Functions
VSI_RegWrite, VSI_RegDelete
VSI_RegWrite
Write a registry value.
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_RunMemoryEater
Eats a percentage of the available memory.
Syntax
VSI_RunMemoryEater("Percentage","Time") |
Parameters
Percentage |
Integer |
Amount of memory to be eaten (in percent) |
Time |
Integer |
Amount of time to run the Memory Eater |
Code Example
VSI_RunMemoryEater(105,30) |
Related Functions
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 it 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 with the next action.
Syntax
VSI_Sleep(Time) |
Parameters
Time |
Integer |
In seconds |
Code Example
VSI_Sleep(30) |
Related Functions
Workload_Idle, Workload_RandomIdle
VSI_Timer41
Perform a timer event. The timer event will perform the response time measurements required for the VSI analyzer to be able to determine if the environment is saturated. The 5 VSI_Timer measurements for Login VSI 4.1.x can be found on the following links: Calculating VSImax v4.1.x and Login VSI 4.1 Timer Metrics.
Syntax
VSI_Timer41() |
Parameters
None
Code Example
VSI_Timer41() |
Related Functions
None
VSI_TypeFromCSV
Sends text input from a CSV file to the currently active application, using the number in the username as reference.
Syntax
VSI_TypeFromCSV(PoolIndex, "MyCSVFile", "Column", PoolSize) |
Parameters
PoolIndex |
Integer |
The position of the value in the pool of available values |
MyCSVFile |
String |
The location of the CSV file to use, for example: "\\{VSI_Server}\{VSI_Share}\TypeFromCSV.csv" |
Column |
String |
The header name of the column to pull value from |
PoolSize |
Integer |
The size of the pool available per user |
Code Example
VSI_TypeFromCSV(1,"\\Appsrv\VSI Share\MyCSVFile.csv", "Patient Name", 3) |
Related Functions
none
VSI_Type_Fixed
Type the defined text.
Syntax
VSI_Type_Fixed("Logname","Text",SendKeyDelay) |
Parameters
Logname |
String |
|
Text |
String |
|
SendKeyDelay |
Integer |
The delay in milliseconds between keystrokes |
Code Example
VSI_Type_Fixed("Logname","Text to type",150) |
Related Functions
VSI_Type_Time
VSI_Type_Sentence
Types a number of sentences, separated by an Enter.
Syntax
VSI_Type_Sentence("Application", "Number of sentences / rows") |
Parameters
Application |
String |
Number of sentences / rows |
Integer |
Code Example
VSI_Type_Sentence("PowerPoint", 2) |
Related Functions
none
VSI_Type_Time
Types random text from the input file (limited by a number of seconds). The text input is randomly generated from the TXT files in the content library.
Syntax
VSI_Type_Time("Logname","Time",SendKeyDelay) |
Parameters
Logname |
String |
|
Time |
Integer |
In seconds |
SendKeyDelay |
Integer |
The delay in milliseconds between keystrokes |
Code Example
VSI_Type_Time("Logname",60,150) |
Related Functions
VSI_Type_Fixed
Web_GoTo
Navigate to a different website via an existing IE browser.
Syntax
Web_GoTo("logname","URL") |
Parameters
Logname |
String |
URL |
String |
Code Example
Web_Goto("Internet", "http://www.loginvsi.nl") |
Related Functions
Web_Quit, Web_Start
Web_GotoByTitle
Will change the URL contained within the browser that matches the specified title.
Syntax
Web_GotoByTitle("LogName", "WindowTitle", "NewURL") |
Parameters
LogName |
String |
WindowTitle |
String |
NewURL |
String |
Code Example
Web_GotoByTitle("IE","BBC","http://www.nu.nl") |
Related Functions
-none-
Web_Quit
Closes the defined browser using the Logname provided when opening IE.
Syntax
Web_Quit("logname") |
Parameters
Logname |
String |
Code Example
Web_Quit("Internet") |
Related Functions
Web_Quit, Web_GoTo
Web_QuitByTitle
This function will terminate the IE browser that matches the specified title.
Syntax
Web_QuitByTitle("LogName", "WindowTitle") |
Parameters
LogName |
String |
WindowTitle |
String |
Code Example
Web_QuitByTitle("IE", "BBC - Homepage") |
Related Functions
-none-
Web_Start
Opens a new IE browser and navigates to the defined URL.
Syntax
Web_Start("logname","URL") |
Parameters
Logname |
String |
URL |
String |
Code Example
Web_Start("Internet","http://www.LoginVSI.com") |
Notes
Please note that every instance of Internet Explorer opened through Web_Start must be closed by Web_Quit. Failure to do so may cause unexpected results.
Related Functions
Web_Quit
Web_Start_Random
Starts a random website via the configured web server. When using this function make sure that the logfile name is unique. If the logfile name already exists the application will not start.
Syntax
Web_Start_Random("Logname", "Base URL", "Website name", "WRSMode", "Maximum amount") |
Parameters
Logname |
String |
|
Base URL |
String |
Base URL of the website locations |
Website |
String |
Website name based on the directory |
WRSMode |
String |
Default "Website" to open a website, change to "Video" to open a video (from the local content pool) |
Maximum amount |
Integer |
Amount of available websites |
Code Example
Web_Start_Random("Logname", "%VSI_WebLocation%", "BBC", "Website", %VSI_Web_BBC%) |
Related Functions
Web_Start, Web_Quit
Workload_Idle
Wait for specified number of seconds before continuing with the next action, but also allows the user to specify a message that will be shown on screen during the idle time.
Syntax
Workload_Idle("Logname", Time, "Message", Bit value) |
Parameters
Logname |
String |
|
Time |
Integer |
In seconds |
Message |
String |
|
Bit value |
Integer |
In seconds or milliseconds |
Code Example
Workload_IDLE("Workload", 30, "%USERNAME% is IDLE", 1) |
Related Functions
VSI_Sleep, Workload_RandomIdle
Workload_RandomIdle
Wait for a random amount of time within the timeframe specified before continuing with the next action, but also allows the user to specify a message that will be shown on screen during the idle time.
Syntax
Workload_RandomIdle("Logname", MinIdle, MaxIdle, "Message") |
Parameters
Logname |
String |
|
MinIdle |
Integer |
In Seconds |
MaxIdle |
Integer |
In Seconds |
Message |
String |
Code Example
Workload_RandomIdle("Logname", 5, 15, "User is on the phone") |
Related Functions
VSI_Sleep, Workload_Idle
Published Apps Functions
Functions listed below are exclusive to the Login VSI version that supports Published Apps.
VSI_AddAppToEnabledList_PA
Adds a specific string to an Enabled (allowed) Apps array. Usage of this array: if any of the elements are not equal (not case-sensitive) to "LogName" in any Workload Function call, the call is skipped.
Syntax
VSI_AddAppToEnabledList_PA("LognameToBeEnabled", FunctionCallCameFromWorkloadFile) |
Parameters
LognameToBeEnabled |
String |
Name of App to add to the Enabled list. By default, the array is empty, meaning that no Apps are executed. |
FunctionCallCameFromWorkloadFile |
Bool |
Specify if the call comes from the Workload or from the Multiple Resource Scenario code. This value is used when the workload is executed in multiple resource scenarios. 0 = from multiple resource code, 1 = from workload (default) |
Code Example
VSI_AddAppToEnabledList_PA("Adobe") |
Related Functions
VSI_LaunchPublishedApp_PA
VSI_ControlCommand_PA
Sends a command to a control. Does not return a value. For more information about this command please click here.
Syntax
VSI_ControlCommand_PA("Logname", "Title", "Text", "ControlId", "Command", ["Option"]) |
Parameters
Logname |
String |
Logname used to filter execution of this function in a Published App scenario |
Title |
String |
The title/hWnd/class of the window to access |
Text |
String |
The text of the window to access |
ControlID |
String |
The control to interact with |
Command |
String |
The command to send to the control |
Option |
String |
Additional parameter required by some commands |
Code Example
VSI_ControlCommand_PA("Logname", "[CLASS:Notepad]", "", "Edit1", "GetLineCount", "") |
Related Functions
VSI_ControlSend_PA, VSI_ControlFocus_PA
VSI_ControlFocus_PA
Sets input focus to a given control on a window.
Syntax
VSI_ControlFocus_PA("Logname", "Title", "Text", ControlId) |
Parameters
Logname |
String |
Logname used to filter execution of this function in a Published App scenario |
Title |
String |
The title/hWnd/class of the window to access |
Text |
String |
The text of the window to access |
ControlID |
String |
The control to interact with |
Code Example
VSI_ControlFocus_PA("Logname", "[CLASS:Notepad]", "", "Edit1") |
Related Functions
VSI_ControlCommand_PA, VSI_ControlSend_PA
VSI_ControlSend_PA
Sends a string of characters to a control.
Syntax
VSI_ControlSend_PA("Logname", "Title", "Text", "ControlId", "String") |
Parameters
Logname |
String |
Logname used to filter execution of this function in a Published App scenario |
Title |
String |
The title/hWnd/class of the window to access |
Text |
String |
The text of the window to access |
ControlID |
String |
The control to interact with |
String |
String |
The string of characters to send to the control |
Code Example
VSI_ControlSend_PA("Logname", "[CLASS:Notepad]", "", "Edit1", "This is a line of text in the notepad window") |
Related Functions
VSI_ControlCommand, VSI_ControlFocus
VSI_Dir_Copy_Wait_PA
Copies a directory and waits for it to complete.
Syntax
VSI_Dir_Copy_Wait_PA("Logname", "Source", "Target") |
Parameters
Logname |
String |
|
Source |
String |
Directory to copy |
Target |
String |
Directory to copy to |
Code Example
VSI_Dir_Copy_Wait_PA("Outlook", "%VSIShare%\_VSI_Content", "%TMP%") |
Related Functions
VSI_CopyRandom
VSI_LaunchPublishedApp_PA
This function will launch the specified published App.
Syntax
VSI_LaunchPublishedApp_PA("Logname", "PublishedAppName", "PublishedAppProcessName") |
Parameters
Logname | String | Logname associated with the published App that's intended to be launched. |
PublishedAppName | String | Name of the published App that's intended to be launched. If left blank, then we will get this value by matching logname (default settings). |
PublishedAppProcessName | String | Name of the published App process executable that's intended to be launched. If left blank, then we will get this value by matching logname (default settings). |
Code Example
VSI_LaunchPublishedApp_PA("IE", "Internet Explorer", "iexplore.exe") |
Related Functions
-none-
VSI_Logoff_PA
Forces the session to log off and reports to the Management Console confirming that the session has been logged off.
Syntax
VSI_Logoff_PA("Logname", "RunTimer") |
Parameters
Logname |
String |
Logname associated with this function call. |
RunTimer |
Integer |
Whether we should perform a Timer function before logoff (0 or 1). |
Code Example
VSI_Logoff_PA("IE", 0) |
Related Functions
-none-
VSI_Mouse_Down
Will press and not release the specified mouse button. The function VSI_Mouse_Up should be used afterwards to release the pressed button.
Syntax
VSI_Mouse_Down("Logname", "MouseButton") |
Parameters
Logname |
String |
|
MouseButton |
String |
Left or Right |
Code Example
VSI_Mouse_Down("Logname","Left") |
Related Functions
VSI_Mouse_Up
VSI_Mouse_Up
Will release the specified mouse button. This function should be used after VSI_Mouse_Down has been called.
Syntax
VSI_Mouse_Up("Logname", "MouseButton") |
Parameters
Logname |
String |
|
MouseButton |
String |
Left or Right |
Code Example
VSI_Mouse_Up("Logname","Left") |
Related Functions
VSI_Mouse_Down
VSI_OutlookInputFocusOnToField_PA
This function will put the keyboard input cursor in the 'To' field when writing an email message. This is useful, as Outlook does not always automatically focus on the 'To' field.
Syntax
VSI_OutlookInputFocusOnToField_PA("Logname", "WindowTitle") |
Parameters
Logname |
String |
WindowTitle |
String |
Code Example
VSI_OutlookInputFocusOnToField_PA("Outlook", "lang:OutlookMessage:lang") |
Related Functions
-none-
VSI_PDF_Print_PA
This function will print a PDF document using the specified printer in the application that matches the specified window title.
Syntax
VSI_PDF_Print_PA("Logname", IsAnofficeSuiteApplication, "PrintWindowName", "OutputPDFFilename", "PrintSourceWindowTitle") |
Parameters
Logname |
String |
|
IsAnOfficeSuiteApplication |
Boolean |
If the application you are prmuosdeinting from is a Microsoft Office application (value: 1 = yes or 0 = no) |
PrintWindowName |
String |
Name of the print window |
OutputPDFFilename |
String |
Name of the PDF file |
PrintSourceWindowTitle |
String |
Name of the source window |
Code Example
PDF_Print_PA("Word", 1, "Doro PDF Writer") |
Related Functions
-none-
VSI_RunMemoryEater_PA
Eats a certain percent of available memory.
Syntax
VSI_RunMemoryEater_PA("Logname", "Percentage", "Time") |
Parameters
Logname |
String |
|
Percentage |
Integer |
Amount of memory to be eaten in percent |
Time |
Integer |
The amount of time to run the Memory Eater |
Code Example
VSI_RunMemoryEater_PA("MemEat", 50, 30) |
Related Functions
- none -
VSI_SetVSITestStartApp_PA
This function specifies what published App should be used to begin the test (not related to Workload). Should be set to VSIStartApp.exe to remove any overhead.
Syntax
VSI_SetVSITestStartApp_PA("Logname", "PublishedAppname", "PublishedAppProcessExeName") |
Parameters
Logname |
String |
Logname associated with the published App that's intended to be launched. |
PublishedAppName |
String |
Name of the published App that's intended to be launched. If left blank, then we will get this value by matching logname (default settings). |
ProcessExeName |
String |
Name of the published App process executable that's intended to be launched. If left blank, then we will get this value by matching logname (default settings). |
Code Example
VSI_SetVSITestStartApp_PA("Launcher", "VSIStartApp", "VSIStartApp.exe") |
Related Functions
-none-
VSI_Sleep_PA
This function will pause the workload execution for the specified amount of time.
Syntax
VSI_Sleep_PA("Logname", SleepDurationInSeconds) |
Parameters
Logname |
String |
SleepDurationInSeconds |
Integer |
Code Example
VSI_Sleep_PA("Sleep", 1) |
Related Functions
-none-
Login VSI Key Commands
For several commands that are used in the Login VSI 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 |
Comments
0 comments
Article is closed for comments.