// TARGET:"C:\Users\Mitchell\AppData\Roaming\Zoom\bin\Zoom.exe" // START_IN: using LoginPI.Engine.ScriptBase; using System; public class Zoom : 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 = 3; // 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(); Wait(waitHeartbeat); //var emailFieldLogin = MainWindow.FindControl(className : "Edit", title : "Zoom*",timeout:metafunctionGlobalTimeout); // This will find username and clear it out MainWindow.FindControl(className : "Button", title : "Sign In with SSO").Click(); Wait(waitHeartbeat); //MainWindow.Focus(); var edgeWindow = FindWindow("*Edge*"); edgeWindow.FindControl(className : "Button:MdTextButton", title : "Open").Click(); Wait(waitHeartbeat); edgeWindow.FindControl(className : "Button:WindowsCaptionButton", title : "Close").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 StartTimer(name:"ZoomLoginTime"); var zoomFullGUI = FindWindow("Zoom",timeout:metafunctionGlobalTimeout); // This will look for the Zoom landing page var settingsButton = zoomFullGUI.FindControl(className : "Button", title : "Setting",timeout:metafunctionGlobalTimeout); //MainWindow.FindControl(className : "Button", title : "Setting").Click(); StopTimer(name:"ZoomLoginTime"); Wait(waitHeartbeat); // This will open the settings page and verify it opens settingsButton.Click(); var settingsWindow = FindWindow("*Settings*",timeout:metafunctionGlobalTimeout); //var settingsWindow = FindWindow(title : "Zoom", 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); 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 : "Start a new meeting with video on",timeout:metafunctionGlobalTimeout).Click(); Wait(waitHeartbeat); var audioZoom = FindWindow("*audio*"); audioZoom.FindControl(className : "Button", title : "Join with Computer Audio").Click(); StartTimer(name:"MeetingBridgeWindowStartTime"); var zoomMeetingBridgeWindow = FindWindow(className : "Win32 Window:ZPContentViewWndClass", title : "Zoom Meeting", 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:"Button", title:"Invite (Alt+I)",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 : "MenuItem", title : "Security",timeout:metafunctionGlobalTimeout); //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 : "*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); //zoomMeetingBridgeWindow.FindControlWithXPath(xPath : "Win32 Window:ATL:58AAA820/Win32 Window:ZPControlPanelClass/Pane/Button[1]/Pane/Pane").Click(); 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 sound",timeout:metafunctionGlobalTimeout); //MainWindow.FindControl(className : "CheckBox", title : "Share sound").Click(); 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 : "Restore",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); var endMeetingOrLeaveMeetingWindow = FindWindow(title : "End*", processName : "Zoom",timeout:metafunctionGlobalTimeout); Wait(waitHeartbeat); endMeetingOrLeaveMeetingWindow.Focus(); endMeetingOrLeaveMeetingWindow.FindControl(className : "Button", title : "End Meeting*",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}{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 } }