using LoginPI.Engine.ScriptBase; public class MultiApptest : ScriptBase { void Execute() { /* -Disclaimer: This workload is provided as-is and might need further configuration and customization to work successfully in each unique environment. For further Professional Services-based customization please consult with the Login VSI Support and Services team. Please refer to the Help Center section "Application Customization" for further self-help information regarding workload crafting and implementation. -Run the workload against the "target" using Script Editor to ensure it will work before uploading it and testing with it -If needed, configure the Set global variables section of this workload -Go through the workload to understand what it's doing. Comment out any unneeded app tests (code blocks) or add on any needed functional testing -Workload version and changelist: --V1.0 | original -Developed with: -Scripting Toolset version Login Enterprise 4.8.4.0 -Last updated on 22 July, 2022 -Built in Chrome using Google Docs and Google Sheets, Chrome version 103.0.5060.134 and Slack version 4.27.154 -winver Windows 10 Pro x64 20H2 */ // Sets variable for Channel to send messages to string SlackChannel = "login-enterprise"; // Starts Chrome and slack START(); StartTimer(name:"Start_Slack"); ShellExecute(@"cmd /c start slack:",forceKillOnExit:true); StopTimer(name:"Start_Slack"); // Sets windows as their own variables var chromeWindow = FindWindow(title: "New Tab - Google Chrome"); var slackWindow = FindWindow(title: "Slack*"); // Brings Chrome into Focus chromeWindow.Focus(); // Finds search bar, clicks, and searches for google docs chromeWindow.FindControl(className : "Edit", title : "Address and search bar").Click(); Type("google docs"); Type("{ENTER}"); // Enter docs landing page StartTimer(name:"Load_Google_Docs"); chromeWindow.FindControl(className : "Hyperlink", title : " Google Docs https://docs.google.com", text : "https://docs.google.com/").Click(); StopTimer(name:"Load_Google_Docs"); Wait(2); // Create new document chromeWindow.FindControl(className : "ListItem", title : "Blank Blank").Click(); Wait(2); StartTimer(name:"Create_New_Document"); chromeWindow.FindControlWithXPath(xPath : "Document:Chrome_RenderWidgetHostHWND/Unknown Window/Image[1]"); StopTimer(name:"Create_New_Document"); // Add text to document Type("This is a virtual user typing into Docs just like a real user! "); chromeWindow.FindControlWithXPath(xPath : "Document:Chrome_RenderWidgetHostHWND/Unknown Window/Image[1]").Type("{ENTER}"); // Create new tab chromeWindow.FindControl(className : "Button", title : "New Tab").Click(); Wait(1); // Click search bar to accept text chromeWindow.FindControl(className : "Edit", title : "Address and search bar").Click(); // Search for google sheets Type("google sheets"); Type("{ENTER}"); StartTimer(name:"Load_Google_Sheets"); // Enter Sheets landing page chromeWindow.FindControl(className : "Hyperlink", title : " Google Sheets: Sign-in https://docs.google.com › spreadsheets", text : "https://docs.google.com/spreadsheets/u/0/?usp=direct_url").Click(); StopTimer(name:"Load_Google_Sheets"); Wait(1); // Create new sheet StartTimer(name:"Create_New_Sheets"); chromeWindow.FindControl(className : "ListItem", title : "Blank Blank").Click(); StopTimer(name:"Create_New_Sheets"); Wait(4); // Create column of data Type("Column"); KeyDown(KeyCode.ENTER); KeyUp(KeyCode.ENTER); Wait(1); Type("1234"); KeyDown(KeyCode.ENTER); KeyUp(KeyCode.ENTER); Wait(1); Type("5678"); KeyDown(KeyCode.ENTER); KeyUp(KeyCode.ENTER); Wait(1); Type("9012"); KeyDown(KeyCode.ENTER); KeyUp(KeyCode.ENTER); Wait(1); // Guide to top of column KeyDown(KeyCode.UP); KeyUp(KeyCode.UP); KeyDown(KeyCode.UP); KeyUp(KeyCode.UP); Wait(1); KeyDown(KeyCode.UP); KeyUp(KeyCode.UP); Wait(1); KeyDown(KeyCode.UP); KeyUp(KeyCode.UP); Wait(1); // Select all data KeyDown(KeyCode.CTRL); KeyDown(KeyCode.KEY_A); KeyUp(KeyCode.CTRL); KeyUp(KeyCode.KEY_A); // Copy data KeyDown(KeyCode.CTRL); KeyDown(KeyCode.KEY_C); KeyUp(KeyCode.CTRL); KeyUp(KeyCode.KEY_C); Wait(1); // Guide to next column KeyDown(KeyCode.RIGHT); KeyUp(KeyCode.RIGHT); KeyDown(KeyCode.RIGHT); KeyUp(KeyCode.RIGHT); Wait(1); // Paste it 5 times for (int i = 0; i < 5; i++) { // Paste column data into new column KeyDown(KeyCode.CTRL); KeyDown(KeyCode.KEY_V); KeyUp(KeyCode.CTRL); KeyUp(KeyCode.KEY_V); Wait(1); KeyDown(KeyCode.RIGHT); KeyUp(KeyCode.RIGHT); Wait(1); } // Guide to last column KeyDown(KeyCode.LEFT); KeyUp(KeyCode.LEFT); Wait(2); // Select all data KeyDown(KeyCode.CTRL); KeyDown(KeyCode.KEY_A); KeyUp(KeyCode.CTRL); KeyUp(KeyCode.KEY_A); // Copy data KeyDown(KeyCode.CTRL); KeyDown(KeyCode.KEY_C); KeyUp(KeyCode.CTRL); KeyUp(KeyCode.KEY_C); Wait(1); // Return to docs tab chromeWindow.FindControl(className : "TabItem", title : "Untitled document - Google Docs").Click(); Wait(1); // Paste into document KeyDown(KeyCode.CTRL); KeyDown(KeyCode.KEY_V); KeyUp(KeyCode.CTRL); KeyUp(KeyCode.KEY_V); Wait(1); // Click to copy unlinked table into document chromeWindow.FindControl(className : "Text", title : "Paste unlinked").Click(); Wait(1); // Confirm copy into document chromeWindow.FindControl(className : "Button", title : "Paste").Click(); Wait(1); // Rename doc chromeWindow.FindControl(className : "Text", title : "Untitled document").Click(); KeyDown(KeyCode.BACKSPACE); KeyUp(KeyCode.BACKSPACE); chromeWindow.FindControl(className : "Text", title : "").Type("LoginEnt."); KeyDown(KeyCode.ENTER); KeyUp(KeyCode.ENTER); Wait(2); slackWindow.Focus(); Wait(1); // Enter login enterprise channel slackWindow.FindControl(className : "Text", title : $"{SlackChannel}").Click(); // Click into chat box slackWindow.FindControl(className : "Edit", title : $"Message to {SlackChannel}").Click(); // Type into chat box slackWindow.FindControl(className : "Edit", title : $"Message to {SlackChannel}").Type("A Login Enterprise virtual user is typing this!"); // Send message slackWindow.FindControl(className : "Button", title : "Send now").Click(); // Exit Slack slackWindow.FindControl(className : "Button", title : "Close").Click(); STOP(); } }