using LoginPI.Engine.ScriptBase; using System; public class zoomWindowsDesktop : 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. -YouTube video: https://youtu.be/v2ldgsngI6c -Run the workload against the "target" using Script Editor to ensure it will work before uploading it and testing with it -Workload version and changelist: --V1.0 | original -Leave Application running compatibility: true Notes: -Please read each of the commented-out portions of this script, to see what it does and if there are lines which should be commented out or changed (variables, for example) -Environment: Win 10 Pro x64 winver 1909 18363.720 | Zoom x86 Windows desktop, version 4.6 | Login Enterprise ScriptingToolset version 4.0.11 This script will: -Start Zoom and validate it will open the process -Log into Zoom with defined credentials and verify it loads the landing page -Open the settings page and verify it opens -Click the Schedule button and verify it opens -Click the Meetings button and verify the Meetings page loads -Click the Contacts button and verify the Contacts page loads -Click the Chats button and verify the Chats page loads -Send a "new chat" to a defined name, and send some test messages -Click the "Start without video" option, which will start a meeting bridge -Click the (Un)Mute microphone button -Open the Invite page and verify it loads -Open the Participants pane and verify it opens -Open the Security button pop-up menu and select Lock Meeting option; verifying this has occurred -Open the Security button pop-up menu and select Enable Waiting Room; verifying this has occurred -Open the Chat Panel in the meeting bridge, verify it opens, and send some test messages in the chat -Turn on the Record to Computer feature, starting the recording, and verifying it's started -Turn on the webcam share and will verify the webcam share has started -Start the screen/desktop sharing of Window #1 (first window) -Click the enable, then disable, full screen buttons -Close the meeting bridge, ending it for all participants -Log out of the Zoom user and verify the logoff has occurred -Close out of the Zoom app */ // Set variables int waitHeartbeat = 1; // This is how long to sleep the workload execution, in seconds, in between functions int metafunctionGlobalTimeout = 60; // This is how long, in seconds, metafunctions will wait before timing out int timeToShareScreenInSeconds = 2; // Define how long to share the screen for here, in seconds string localHostname = System.Environment.MachineName; string localUsername = Environment.UserDomainName + "\\" + Environment.UserName; // End set variables section // This is optional to kill Zoom process before starting the interactions ShellExecute("taskkill /f /im zoom*",waitForProcessEnd:true,timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); // This will start Zoom and validate it will open. This is encapsulated in a custom timer StartTimer(name:"ZoomWindowsDesktopStartTime"); START(mainWindowTitle : "Zoom Cloud Meetings", processName : "Zoom",timeout:metafunctionGlobalTimeout); var signInButton = MainWindow.FindControl(className : "Button", title : "Sign In",timeout:metafunctionGlobalTimeout); StopTimer(name:"ZoomWindowsDesktopStartTime"); Wait(waitHeartbeat); // This will log into Zoom and verify it loads the landing page. This is encapsulated in a custom timer signInButton.Click(); var emailFieldLogin = MainWindow.FindControl(className : "Edit", title : "Email*",timeout:metafunctionGlobalTimeout); // This will find username and clear it out Wait(waitHeartbeat); MainWindow.Focus(); emailFieldLogin.Click(); Type("{alt+a}{backspace}",cpm:2000); Type(ApplicationUser,hideInLogging:true,cpm:2000); // Configure this in the Application page in the Login Enterprise web GUI -> edit the Application -> add the username Type("{tab}",cpm:2000); Type(ApplicationPassword,hideInLogging:true,cpm:2000); // Configure this in the Application page in the Login Enterprise web GUI -> edit the Application -> add the password Type("{enter}",cpm:2000); StartTimer(name:"ZoomLoginTime"); var zoomFullGUI = FindWindow(className:"Win32 Window:ZPPTMainFrmWndClassEx",title : "Zoom*", processName : "Zoom",timeout:metafunctionGlobalTimeout); // This will look for the Zoom landing page var settingsButton = zoomFullGUI.FindControl(className : "Button", title : "Setting",timeout:metafunctionGlobalTimeout); StopTimer(name:"ZoomLoginTime"); Wait(waitHeartbeat); // This will open the settings page and verify it opens settingsButton.Click(); var settingsWindow = FindWindow(title : "Settings", processName : "Zoom",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); settingsWindow.Close(); zoomFullGUI.Focus(); // This will open the Schedule button, and verify the Schedule page loads var scheduleButton = zoomFullGUI.FindControl(className : "Button", title : "Schedule",timeout:metafunctionGlobalTimeout); scheduleButton.Click(); var scheduleWindow = FindWindow(title : "Schedule *", processName : "Zoom",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); scheduleWindow.Close(); zoomFullGUI.Focus(); // This will open the Meetings button, and verify the Meetings page loads zoomFullGUI.FindControl(className : "TabItem", title : "Meetings",timeout:metafunctionGlobalTimeout).Click(); zoomFullGUI.FindControl(className : "TabItem", title : "Upcoming meetings",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); // This will open the Contacts button, and verify the Contacts page loads zoomFullGUI.FindControl(className : "TabItem", title : "Contacts",timeout:metafunctionGlobalTimeout).Click(); zoomFullGUI.FindControl(className : "Text", title : "My Contacts",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); // This will open the Chats button, and verify the Chats page loads zoomFullGUI.FindControl(className : "TabItem", title : "Chat",timeout:metafunctionGlobalTimeout).Click(); Wait(waitHeartbeat); // This will start a New Chat, open a new chat to the defined name, and send some test messages var chatSearchField = zoomFullGUI.FindControl(className : "Edit", title : "Jump to contact*",timeout:metafunctionGlobalTimeout).Click(); Wait(waitHeartbeat); Type("kevin{enter}",cpm:2000); // Add the employee name to chat to here var newMessageField = zoomFullGUI.FindControl(className : "Edit", title : "* Message *",timeout:metafunctionGlobalTimeout).Click(); // This is the part that will send the test messages int startMessageLoopInt = 0; while(startMessageLoopInt <= 1) // Define how many message send loops to perform here { Wait(2); Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; Type("I'm user " + localUsername + " on host " + localHostname + ". The UTC Unix time in seconds is " + unixTimestamp + ".{enter}",cpm:9999); Log(startMessageLoopInt); startMessageLoopInt++; } zoomFullGUI.Focus(); Wait(waitHeartbeat); // This will open the Starting a new meeting, which will start a meeting bridge. This is encapsulated in a custom timer zoomFullGUI.FindControl(className : "TabItem", title : "Home",timeout:metafunctionGlobalTimeout).Click(); zoomFullGUI.FindControl(className : "Button", title : "Starting a new meeting with video on",timeout:metafunctionGlobalTimeout).Click(); StartTimer(name:"MeetingBridgeWindowStartTime"); var zoomMeetingBridgeWindow = FindWindow(className : "Win32 Window:ZPContentViewWndClass", title : "Zoom", processName : "Zoom",timeout:metafunctionGlobalTimeout); var muteButton = zoomMeetingBridgeWindow.FindControl(className : "Button", title : "*ute*",timeout:metafunctionGlobalTimeout); StopTimer(name:"MeetingBridgeWindowStartTime"); zoomMeetingBridgeWindow.Focus(); zoomMeetingBridgeWindow.Maximize(); Wait(waitHeartbeat); var titleBar = zoomMeetingBridgeWindow.FindControl(className : "TitleBar",timeout:metafunctionGlobalTimeout); var zoomMeetingMainPane = zoomMeetingBridgeWindow.FindControl(className : "Win32 Window:VideoRenderWndClass", title : "Video Content",timeout:metafunctionGlobalTimeout); zoomMeetingMainPane.Click(); Wait(waitHeartbeat); Type("{alt+a}"); // This will un-mute Wait(waitHeartbeat); // This will open up the Invite window and verify it opens, then close it zoomMeetingMainPane.Click(); Wait(waitHeartbeat); Type("{alt+i}"); var inviteWindow = FindWindow(title : "*Invite*", processName : "Zoom",timeout:metafunctionGlobalTimeout); inviteWindow.FindControl(className : "TabItem", title : "Contacts",timeout:metafunctionGlobalTimeout); inviteWindow.Focus(); Wait(waitHeartbeat); Type("{esc}"); Wait(waitHeartbeat); // This will open the Participants pane and verify it opens zoomMeetingMainPane.Click(); Wait(waitHeartbeat); Type("{alt+u}"); zoomMeetingBridgeWindow.FindControl(className : "Unknown Window", title : "Participants (*",timeout:metafunctionGlobalTimeout); // This will open the Security button pop-up menu and select Lock Meeting option; verifying this has occurred zoomMeetingMainPane.Click(); Wait(waitHeartbeat); var securityButton = zoomMeetingBridgeWindow.FindControl(className : "Button", title : "Security",timeout:metafunctionGlobalTimeout); securityButton.Click(); Wait(waitHeartbeat); Type("{down}{enter}"); FindWindow(className : "Win32 Window:ZPContentViewWndClass", title : "Zoom (Meeting Locked)", processName : "Zoom",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); // This will open the Security button pop-up menu and select Enable Waiting Room; verifying this has occurred zoomMeetingMainPane.Click(); Wait(waitHeartbeat); securityButton.Click(); Wait(waitHeartbeat); Type("{down}{down}{enter}"); zoomMeetingBridgeWindow.FindControl(className : "Text", title : "You have enabled the waiting room",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); // This will open the Chat Panel, verify it opens, and send some test messages in the chat zoomMeetingMainPane.Click(); Wait(waitHeartbeat); Type("{alt+h}"); zoomMeetingBridgeWindow.FindControl(title : "Zoom Group Chat",timeout:metafunctionGlobalTimeout); // This is the part that will send the test messages int startMessageLoopIntMeetingBridge = 0; while(startMessageLoopIntMeetingBridge <= 1) // Define how many message send loops to perform here { Wait(2); Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; Type("I'm user " + localUsername + " on host " + localHostname + ". The UTC Unix time in seconds is " + unixTimestamp + ".{enter}",cpm:9999); Log(startMessageLoopIntMeetingBridge); startMessageLoopIntMeetingBridge++; } // This will turn on the Record to Computer feature, starting the recording, and verifying it's started Wait(waitHeartbeat); zoomMeetingMainPane.Click(); Wait(waitHeartbeat); Type("{alt+r}",cpm:2000); Wait(waitHeartbeat); Type("{esc}",cpm:2000); var recordingButton = zoomMeetingBridgeWindow.FindControl(className : "Button", title : "Recording…",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); // This will turn on the webcam share, and will verify the webcam share has started zoomMeetingMainPane.Click(); Wait(waitHeartbeat); Type("{alt+v}",cpm:2000); Wait(waitHeartbeat); titleBar.Click(); zoomMeetingBridgeWindow.FindControl(className : "Button", title : "stop my video",timeout:metafunctionGlobalTimeout); Wait(2); // This will start the screen/desktop sharing of Window (1) (first window) zoomMeetingMainPane.Click(); Wait(waitHeartbeat); Type("{alt+s}",cpm:2000); var shareWindow = FindWindow(title : "Select a window*", processName : "Zoom",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); shareWindow.Focus(); // This will share the computers sound, by clicking on the Share Computer Sound checkbox var shareComputerSoundButton = shareWindow.FindControl(className : "CheckBox", title : "Share computer sound",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); shareComputerSoundButton.Click(); // This is the part that actually shares the screen, verifying the screen has been shared var shareYourScreenButton = shareWindow.FindControl(className : "ListItem", title : "*share your entire*",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); var shareButton = shareWindow.FindControl(className : "Button", title : "Share Screen",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); shareButton.Click(); var meetingControlsWindow = FindWindow(title : "Meeting Controls", processName : "Zoom",timeout:metafunctionGlobalTimeout); var stopShareButton = meetingControlsWindow.FindControl(className : "Button", title : "Stop Share",timeout:metafunctionGlobalTimeout); // This is how long the screenshare session will last for: Wait(timeToShareScreenInSeconds); meetingControlsWindow.Focus(); Wait(waitHeartbeat); // This will stop the sharing zoomMeetingMainPane.Click(); Wait(waitHeartbeat); stopShareButton.Click(); // This will enable, then disable full screen var enterFullScreenButton = zoomMeetingBridgeWindow.FindControl(className : "Button", title : "Enter Full Screen",timeout:metafunctionGlobalTimeout); zoomMeetingMainPane.Click(); Wait(waitHeartbeat); enterFullScreenButton.Click(); Wait(2); Type("{esc}",cpm:2000); enterFullScreenButton.Focus(); Wait(waitHeartbeat); // This will close the meeting bridge, ending it for all participants var zoomMeetingBridgeWindowCloseButton = zoomMeetingBridgeWindow.FindControl(className : "Button", title : "Close",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); zoomMeetingBridgeWindowCloseButton.Click(); var endMeetingOrLeaveMeetingWindow = FindWindow(title : "End Meeting or Leave Meeting?", processName : "Zoom",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); endMeetingOrLeaveMeetingWindow.Focus(); endMeetingOrLeaveMeetingWindow.FindControl(className : "Button", title : "End Meeting for All",timeout:metafunctionGlobalTimeout).Click(); Wait(waitHeartbeat); zoomFullGUI.Focus(); // This will start the logoff sequence var statusButton = zoomFullGUI.FindControl(className : "SplitButton", title : "*Status*",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); statusButton.Click(); Wait(waitHeartbeat); // The following will perform the logoff, verify the logoff has occurred, and this is encapsulated in a custom timer Type("{up}{up}{enter}"); StartTimer(name:"TimeToLogoff"); var logoffWindow = FindWindow(title : "Zoom Cloud Meetings", processName : "Zoom",timeout:metafunctionGlobalTimeout); var emailFieldLoginAferLogout = logoffWindow.FindControl(className : "Edit", title : "Email*",timeout:metafunctionGlobalTimeout); StopTimer(name:"TimeToLogoff"); Wait(waitHeartbeat); // This is so if, when closing Zoom, the Converting Video window exists, then it will close out of it var convertingVideoWindow = FindWindow(title : "*Zoom - C*", processName : "zTscoder",timeout:2,continueOnError:true); if (convertingVideoWindow != null) { var convertingVideoWindowCloseButton = convertingVideoWindow.FindControl(className : "Button", title : "*Stop*",timeout:1,continueOnError:true).Click(); Wait(waitHeartbeat); convertingVideoWindow.FindControl(className : "Button", title : "*Stop*",timeout:1,continueOnError:true).Click(); } Wait(waitHeartbeat); // This will close out of the Zoom app STOP(); ShellExecute("taskkill /f /im zoom*",waitForProcessEnd:true,timeout:metafunctionGlobalTimeout); // This is optional to kill Zoom process } }