Segment Startup

From Login VSI Documentation
Jump to: navigation, search

Segment Startup

This page explains how the starting segment is chosen and how the so called startup segment works.

Starting segment

By default Login VSI users start in different segments. The default workloads contain 4 segments so the starting segment looks like:

  • User 1 - segment 1
  • User 2 - segment 2
  • User 3 - segment 3
  • User 4 - segment 4
  • User 5 - segment 1
  • User 6 - segment 2
  • User 7 - segment 3
  • User 8 - segment 4
  • User 9 - segment 1
  • ...

Please note that this behavior wasn't working correctly in earlier versions of VSI. The intended behavior was fixed in version 4.0.5

Startup segment

Sometimes applications run across segments. If a user starts in, for example, segment 3 instead of 1 then there might be interactions with applications that are not running. See the table below for a simplified example. In the example Excel is started only in segment 1. But the workload will try to interact with Excel in later segments. If the user starts in segment 3 this would generate a problem.

Segment("Workload", "Prepare")

Segment("Workload", 1)

VSI_random_File_Copy("Excel1", "XLSX", "%VSI_Userhome%\Spreadsheet.xlsx")
App_Start("Excel1", "", "%VSI_Userhome%\Spreadsheet.xlsx", "Title", "Spreadsheet")

Segment("Workload", 2)

App_Focus("Excel1", "Title", "Excel", "", "Maximize")
VSI_Type_Fixed("Excel1","{f5}")
App_Focus("Excel1", "Title", "lang:ExcelGoto:lang")
VSI_Type_Fixed("Excel1","A1{enter}{esc}{esc}")

Segment("Workload", 3)

App_Focus("Excel1", "Title", "Spreadsheet")
VSI_Save("Excel1","{ctrldown}s{ctrlup}", "%VSI_Userhome%\Spreadsheet.xlsx")
App_Close("Excel1", "Title", "Spreadsheet")


To account for this the engine will start these application during the so called startup segment. The startup segment is dynamically created. The startup segment is executed before the prepare segment (that can be found in the workload file). The content of the startup segment is determined by parsing the workload file looking for applications that should still be running from previous segments. In the case of our example this is Excel. The engine will look for the following statements

  • App_Start
  • App_Focus
  • Web_Start_Random
  • Web_Start
  • VSI_random_File_Copy

If these statements don't have a matching app_close or web_quit statement (matched on logname) before the starting segment then the statements will be executed during the startup segment. The VSI_random_File_Copy statement is included because many applications are opened by opening a file that is associated to the application. Like in the example Excel is not opened directly but instead a xlsx file is opened. To ensure that this functionality works VSI_random_File_Copy is included in the startup segment.

Exceptions

There is currently 1 exception to the above logic. In some cases VSI_random_File_Copy is used to simply copy files, not to grab a random file to start an application with. In that case an additional parameter can be passed to VSI_random_File_Copy. The 4th parameter of VSI_Random_File_Copy indicates if this copy should be ignored in the startup segment.

Logging

When engine debugging is enabled the application starting during the startup segment are logged to the engine debug log. See Management Console explained on how to enable engine debugging.

2014-12-16 11:35:29,Starting in other segment than 1, launching required applications from previous segments
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,docx,%VSI_Userhome%\Project1\1.docx,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,docx,%VSI_Userhome%\Project1\2.docx,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,docx,%VSI_Userhome%\Project1\3.docx,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,docx,%VSI_Userhome%\Project1\4.docx,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,pdf,%VSI_Userhome%\Project1\1.pdf,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,pdf,%VSI_Userhome%\Project1\2.pdf,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,pdf,%VSI_Userhome%\Project1\3.pdf,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,pdf,%VSI_Userhome%\Project1\4.pdf,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,docx,%VSI_Userhome%\Project1\1.docx,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,docx,%VSI_Userhome%\Project1\2.docx,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,docx,%VSI_Userhome%\Project1\3.docx,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,docx,%VSI_Userhome%\Project1\4.docx,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,pdf,%VSI_Userhome%\Project1\1.pdf,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,pdf,%VSI_Userhome%\Project1\2.pdf,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,pdf,%VSI_Userhome%\Project1\3.pdf,1)
2014-12-16 11:35:29,Pre-Segment function skip: VSI_Random_File_Copy(Project1,pdf,%VSI_Userhome%\Project1\4.pdf,1)
2014-12-16 11:35:29,Pre-Segment function execute: App_Start
2014-12-16 11:35:29,Expanded environment variables
2014-12-16 11:35:29, From: %programfiles%\Microsoft Office\Office%VSI_OfficeVersion%
2014-12-16 11:35:29, To : C:\Program Files (x86)\Microsoft Office\Office%VSI_OfficeVersion%
2014-12-16 11:35:34,Pre-Segment function execute: App_Focus
2014-12-16 11:35:41,Pre-Segment function execute: Web_Start_Random
2014-12-16 11:35:41,Expanded environment variables
2014-12-16 11:35:41, From: %VSI_WebLocation%
2014-12-16 11:35:41, To : \\LoginVSI-2\VSIShare2\_VSI_Websites
2014-12-16 11:35:41,Expanded environment variables
2014-12-16 11:35:41, From: %VSI_Web_BBC%
2014-12-16 11:35:41, To : 20
2014-12-16 11:35:48,Pre-Segment function execute: App_Focus
2014-12-16 11:35:55,Pre-Segment function execute: Web_Start_Random
2014-12-16 11:35:55,Expanded environment variables
2014-12-16 11:35:55, From: %VSI_WebLocation%
2014-12-16 11:35:55, To : \\LoginVSI-2\VSIShare2\_VSI_Websites
2014-12-16 11:35:55,Expanded environment variables
2014-12-16 11:35:55, From: %VSI_Web_TheVerge%
2014-12-16 11:35:55, To : 20
2014-12-16 11:37:43,Pre-Segment function execute: App_Focus
2014-12-16 11:37:50,Pre-Segment function execute: VSI_Random_File_Copy
2014-12-16 11:37:50,Expanded environment variables
2014-12-16 11:37:50, From: %VSI_Userhome%\UserEdit2.doc
2014-12-16 11:37:50, To : H:\UserEdit2.doc
2014-12-16 11:37:50,Copy Random file: doc
2014-12-16 11:37:54,Pre-Segment function execute: App_Start
2014-12-16 11:37:54,Expanded environment variables
2014-12-16 11:37:54, From: %VSI_Userhome%\UserEdit2.doc
2014-12-16 11:37:54, To : H:\UserEdit2.doc
2014-12-16 11:37:58,Pre-Segment function execute: App_Focus
2014-12-16 11:38:05,Pre-Segment function execute: VSI_random_File_Copy
2014-12-16 11:38:05,Expanded environment variables
2014-12-16 11:38:05, From: %VSI_Userhome%\PDF1.pdf
2014-12-16 11:38:05, To : H:\PDF1.pdf
2014-12-16 11:38:05,Copy Random file: PDF
2014-12-16 11:38:08,Pre-Segment function execute: App_Start
2014-12-16 11:38:08,Expanded environment variables
2014-12-16 11:38:08, From: %VSI_Userhome%\PDF1.pdf
2014-12-16 11:38:08, To : H:\PDF1.pdf
2014-12-16 11:38:13,Pre-Segment function execute: App_Focus
2014-12-16 11:38:20,Pre-Segment function execute: VSI_random_File_Copy
2014-12-16 11:38:20,Expanded environment variables
2014-12-16 11:38:20, From: %VSI_Userhome%\UserPresentation.ppt
2014-12-16 11:38:20, To : H:\UserPresentation.ppt
2014-12-16 11:38:20,Copy Random file: PPT
2014-12-16 11:38:23,Pre-Segment function execute: App_Start
2014-12-16 11:38:23,Expanded environment variables
2014-12-16 11:38:23, From: %VSI_Userhome%\UserPresentation.ppt
2014-12-16 11:38:23, To : H:\UserPresentation.ppt
2014-12-16 11:38:27,Pre-Segment function execute: App_Focus