using LoginPI.Engine.ScriptBase; public class googleEarthProDesktop : ScriptBase { private 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/glMhH8UDUPg -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 -Workload version and changelist: --V1.0 | original -Leave Application running compatibility: true -Recommended to read through the comments of this script to understand what it's doing and modify anything needing to be -This script will: -Launch Google Earth Pro, verifying it opens with a custom timer encapsulation -Move the rendered Earth 3D object around with arrow keys -Navigate to defined locations, entering the flight simulator for each. Predefined locations are Boston and Amsterdam -Navigate to the sky, Mars, and the Moon, entering the flight simulator for each -Close out of the Google Earth Pro application -Development environmental information: -Login Enterprise scriptingtoolset version 4.2.14 -Winver 2004 OS Build 19041.508 Windows 10 Professional x64 -Google Earth Pro (Windows Desktop) version 7.3.3.7786 64-bit */ // Setting global variables int globalFunctionTimeoutInSeconds = 20; int globalIntermittentWaitInSecondsShort = 1; int globalIntermittentWaitInSecondsMiddle = 3; int globalIntermittentWaitInSecondsLong = 10; int globalCharactersPerMinuteToType = 2000; ShellExecute("cmd /c taskkill /f /im googleearth*",waitForProcessEnd:true,timeout:globalFunctionTimeoutInSeconds); // Optional; taskkill Earth if already running // This will start the app, verify it's opened, and record how long it takes StartTimer("TimeToGoogleEarthLandingPage"); START(mainWindowTitle:"Google Earth Pro",mainWindowClass:"Win32 Window:Qt5QWindowIcon",processName:"googleearth",timeout:globalFunctionTimeoutInSeconds); MainWindow.FindControl(className : "TreeItem", title : "My Places",timeout:globalFunctionTimeoutInSeconds); StopTimer("TimeToGoogleEarthLandingPage"); Wait(globalIntermittentWaitInSecondsLong); // This will move the earth render object around with arrow keys var googleEarth3DRenderFrame = MainWindow.FindControl(className : "Pane:Qt5QWindowIcon", title : "RenderWidgetWindow",timeout:globalFunctionTimeoutInSeconds); googleEarth3DRenderFrame.Focus(); MainWindow.Maximize(); Wait(globalIntermittentWaitInSecondsMiddle); KeyDown(KeyCode.LEFT); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.LEFT); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.UP); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.UP); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.SHIFT); KeyDown(KeyCode.LEFT); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.SHIFT); KeyUp(KeyCode.LEFT); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.SHIFT); KeyDown(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.SHIFT); KeyUp(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.PLUS); Wait(globalIntermittentWaitInSecondsShort); KeyUp(KeyCode.PLUS); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.MINUS); Wait(globalIntermittentWaitInSecondsShort); KeyUp(KeyCode.MINUS); Wait(globalIntermittentWaitInSecondsShort); googleEarth3DRenderFrame.Type("nur",cpm:globalCharactersPerMinuteToType); // This centers the view Wait(globalIntermittentWaitInSecondsMiddle); // This will navigate to defined locations by searching for them, and going into flight simulator with them var searchField = MainWindow.FindControlWithXPath(xPath : "Pane:Qt5QWindowIcon/SplitButton:Qt5QWindowIcon/SplitButton:Qt5QWindowIcon/Unknown[2]/Unknown/Unknown[1]/Unknown/Unknown/Edit",timeout:globalFunctionTimeoutInSeconds); // This looks for the search field Wait(globalIntermittentWaitInSecondsShort); searchField.Click(); Wait(globalIntermittentWaitInSecondsShort); Type("300 Tradecenter Suite 3460 Woburn MA 01801{enter}",cpm:globalCharactersPerMinuteToType); // Input the location to navigate the 3d frame to here Wait(globalIntermittentWaitInSecondsLong); googleEarth3DRenderFrame.Type("nur",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsShort); Type("{CTRL+ALT+A}",cpm:globalCharactersPerMinuteToType); // This will enter flight simulation mode var flightSimulatorOptionsWindow = FindWindow(className : "Win32 Window:Qt5QWindowIcon", title : "Flight Simulator", processName : "googleearth",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSecondsShort); flightSimulatorOptionsWindow.Type("{enter}",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsShort); Type("{esc}",cpm:globalCharactersPerMinuteToType); // This will close flight simulation mode Wait(globalIntermittentWaitInSecondsMiddle); googleEarth3DRenderFrame.Type("nur",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsShort); searchField.Click(); Wait(globalIntermittentWaitInSecondsShort); Type("{ctrl+a}{back}Maassluisstraat 2 1062 GD Amsterdam The Netherlands{enter}",cpm:globalCharactersPerMinuteToType); // Input the location to navigate the 3d frame to here Wait(globalIntermittentWaitInSecondsLong); googleEarth3DRenderFrame.Type("nur",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsShort); Type("{CTRL+ALT+A}"); // This will enter flight simulation mode FindWindow(className : "Win32 Window:Qt5QWindowIcon", title : "Flight Simulator", processName : "googleearth",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSecondsShort); flightSimulatorOptionsWindow.Type("{enter}",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsShort); Type("{esc}",cpm:globalCharactersPerMinuteToType); // This will close flight simulation mode Wait(globalIntermittentWaitInSecondsMiddle); googleEarth3DRenderFrame.Type("nur",cpm:globalCharactersPerMinuteToType); // This will open the 3d renderings of the sky, Mars, and the moon, into the 3d rendering frame; also, enter the flight simulator for each var change3dRenderingObjectDropDownMenu = MainWindow.FindControlWithXPath(xPath : "Pane:Qt5QWindowIcon/SplitButton:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon[1]/Unknown/SplitButton/Unknown/MenuItem",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSecondsMiddle); change3dRenderingObjectDropDownMenu.Click(); Wait(globalIntermittentWaitInSecondsShort); Type("{down}{down}{enter}",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsLong); googleEarth3DRenderFrame.Type("nur",cpm:globalCharactersPerMinuteToType); var change3dRenderingObjectDropDownMenu2 = MainWindow.FindControlWithXPath(xPath : "Pane:Qt5QWindowIcon/SplitButton:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon[1]/Unknown/SplitButton/Unknown/MenuItem",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSecondsMiddle); change3dRenderingObjectDropDownMenu2.Click(); Type("{down}{down}{down}{enter}",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsLong); Type("{CTRL+ALT+A}"); // This will enter flight simulation mode FindWindow(className : "Win32 Window:Qt5QWindowIcon", title : "Flight Simulator", processName : "googleearth",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSecondsShort); flightSimulatorOptionsWindow.Type("{enter}",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsShort); Type("{esc}",cpm:globalCharactersPerMinuteToType); // This will close flight simulation mode Wait(globalIntermittentWaitInSecondsMiddle); googleEarth3DRenderFrame.Type("nur",cpm:globalCharactersPerMinuteToType); var change3dRenderingObjectDropDownMenu3 = MainWindow.FindControlWithXPath(xPath : "Pane:Qt5QWindowIcon/SplitButton:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon/Pane:Qt5QWindowIcon[1]/Unknown/SplitButton/Unknown/MenuItem",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSecondsMiddle); change3dRenderingObjectDropDownMenu3.Click(); Type("{down}{down}{down}{down}{enter}",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsLong); Type("{CTRL+ALT+A}",cpm:globalCharactersPerMinuteToType); // This will enter flight simulation mode FindWindow(className : "Win32 Window:Qt5QWindowIcon", title : "Flight Simulator", processName : "googleearth",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSecondsShort); flightSimulatorOptionsWindow.Type("{enter}",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.DOWN); Wait(globalIntermittentWaitInSecondsShort); KeyDown(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsMiddle); KeyUp(KeyCode.RIGHT); Wait(globalIntermittentWaitInSecondsShort); Type("{esc}",cpm:globalCharactersPerMinuteToType); // This will close flight simulation mode Wait(globalIntermittentWaitInSecondsMiddle); googleEarth3DRenderFrame.Type("nur",cpm:globalCharactersPerMinuteToType); Wait(globalIntermittentWaitInSecondsMiddle); STOP(); // This will close out of the app } }