using LoginPI.Engine.ScriptBase; public class windowsPaint3D : 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/Qikx-vX-pzQ -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: false This workload will: -Simulate a user opening the built-in Windows 10 Paint 3D app and performing various 3D rendering tasks as an actual user might perform. This generates realistic graphically-intensive load. The following steps will be performed: -Opening app and capturing app-opening timing with a custom timer -Opening 2D shapes page, clicking the Multipoint Star shape, drawing/committing it to canvas, converting it to 3D, and moving it back and forth in 3D space -Opening 3D shapes page, clicking the Cat shape, drawing/committing it to canvas, and moving it back and forth in 3D space -Opening Stickers page, clicking the Bark texture, drawing/committing it to canvas, converting it to 3D and moving it back and forth in 3D space -Opening Text page, clicking the 3D text button, typing to text field, drawing/committing it to canvas, and moving it back and forth in 3D space -Opening Effects page and cycling through the different (lighting) Effects -*Comment this section out of the code if the targets don't have an internet connection* Opening 3D library page, opening Latest 3D Collections page, drawing/committing the top-left model in the Latest 3D Collections page, and moving it back and forth in 3D space -Zooming into the canvas all the way, resetting the view, zooming out of the canvas all the way, then resetting the view again -Closing out of the Paint 3D app Supplemental information: -If needed, configure the "Set global vars" 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 -Developed with: Login Enterprise Scripting Toolset version 4.6.5, Windows 10 Pro x64 21H1 -Last updated on: 12 Oct 2021 */ // Setting global vars int globalFunctionTimeoutInSeconds = 60; int globalCharactersPerMinuteToTypeStrings = 2000; double globalIntermittentWaitInSeconds = 0.3; int globalCharactersPerMinuteToTypeThemeChange = 120; int globalCharactersPerMinuteToTypeZooming = 240; MouseMove(1,1); // Optional -- killing 3D viewer if it's already open ShellExecute("cmd /c taskkill /f /im ApplicationFrameHost.ex*",waitForProcessEnd:true,timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); // Invoking the application and verifying it's running; using custom timer StartTimer("WindowsPaint3D_InvocationTime"); ShellExecute(@"cmd /c start ms-paint:",waitForProcessEnd:false,forceKillOnExit:true,timeout:globalFunctionTimeoutInSeconds); var MainWindow = FindWindow(title:"* Paint 3D*", className:"Win32 Window:ApplicationFrameWindow",processName:"ApplicationFrameHost",timeout:globalFunctionTimeoutInSeconds); var mainCanvasPane = MainWindow.FindControlWithXPath(xPath : "Xaml Window:Windows.UI.Core.CoreWindow/Group",timeout:globalFunctionTimeoutInSeconds); // Finding the main canvas pane StopTimer("WindowsPaint3D_InvocationTime"); MainWindow.Maximize(); MainWindow.Focus(); Wait(globalIntermittentWaitInSeconds); // Opening 2D shapes page, clicking the Multipoint Star shape, drawing/committing it to canvas, converting it to 3D, and moving it back and forth in 3D space var twoDShapesButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "2D shapes",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); twoDShapesButton.Click(); var multipointStarShapeButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "Multipoint star",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); multipointStarShapeButton.Click(); Wait(globalIntermittentWaitInSeconds); mainCanvasPane.Click(); var make3DButton2DShapes = MainWindow.FindControl(className : "Button:Button", title : "Make 3D",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); make3DButton2DShapes.Click(); var zAxisPositionButton2DShapes = MainWindow.FindControl(className : "Group:NamedContainerAutomationPeer", title : "Z-axis position",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); zAxisPositionButton2DShapes.MoveMouseToCenter(); MouseDown(); MouseMove(1,1); Wait(globalIntermittentWaitInSeconds); mainCanvasPane.MoveMouseToCenter(); MouseUp(); // Opening 3D shapes page, clicking the Cat shape, drawing/committing it to canvas, and moving it back and forth in 3D space var threeDShapesButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "3D shapes",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); threeDShapesButton.Click(); var catShapeButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "Cat",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); catShapeButton.Click(); Wait(globalIntermittentWaitInSeconds); mainCanvasPane.Click(); var zAxisPositionButton3DShapes = MainWindow.FindControl(className : "Group:NamedContainerAutomationPeer", title : "Z-axis position",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); zAxisPositionButton3DShapes.MoveMouseToCenter(); Wait(globalIntermittentWaitInSeconds); MouseDown(); MouseMove(1,1); Wait(globalIntermittentWaitInSeconds); mainCanvasPane.MoveMouseToCenter(); MouseUp(); // Opening Stickers page, clicking the Bark texture, drawing/committing it to canvas, converting it to 3D and moving it back and forth in 3D space var stickersButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "Stickers",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); stickersButton.Click(); var barkTextureButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "Bark",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); barkTextureButton.Click(); Wait(globalIntermittentWaitInSeconds); mainCanvasPane.Click(); Wait(globalIntermittentWaitInSeconds); var make3DButtonStickers = MainWindow.FindControl(className : "Button:Button", title : "Make 3D",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); make3DButtonStickers.Click(); var zAxisPositionButtonStickers = MainWindow.FindControl(className : "Group:NamedContainerAutomationPeer", title : "Z-axis position",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); zAxisPositionButtonStickers.MoveMouseToCenter(); Wait(globalIntermittentWaitInSeconds); MouseDown(); MouseMove(1,1); Wait(globalIntermittentWaitInSeconds); mainCanvasPane.MoveMouseToCenter(); MouseUp(); // Opening Text page, clicking the 3D text button, typing to text field, drawing/committing it to canvas, and moving it back and forth in 3D space var textButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "Text",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); textButton.Click(); var threeDTextButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "3D text",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); threeDTextButton.Click(); var chooseAColorButton = MainWindow.FindControl(className : "Button:Button", title : "Choose a color",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); chooseAColorButton.Click(); Wait(globalIntermittentWaitInSeconds); MainWindow.Type("{down}{enter}",cpm:globalCharactersPerMinuteToTypeStrings,hideInLogging:false); // Changing the text color var alignTextCentered = MainWindow.FindControl(className : "RadioButton:RadioButton", title : "Center your text",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); alignTextCentered.Click(); // Aligning the text to center Wait(globalIntermittentWaitInSeconds); mainCanvasPane.Click(); var resizeTopRightButton = MainWindow.FindControl(className : "Custom", title : "Resize top right",timeout:globalFunctionTimeoutInSeconds); // Making sure the text editor bubble pane is open Wait(globalIntermittentWaitInSeconds); MainWindow.Type("Login Enterprise{enter}",cpm:globalCharactersPerMinuteToTypeStrings,hideInLogging:false); Wait(globalIntermittentWaitInSeconds); resizeTopRightButton.MoveMouseToCenter(); MouseMoveBy(dx:50,dy:0,continueOnError:false); // Moving mouse pointer away from the text editing bubble Click(); // This will commit the text to the canvas var zAxisPositionButton3DText = MainWindow.FindControl(className : "Group:NamedContainerAutomationPeer", title : "Z-axis position",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); zAxisPositionButton3DText.MoveMouseToCenter(); Wait(globalIntermittentWaitInSeconds); MouseDown(); MouseMove(1,1); Wait(globalIntermittentWaitInSeconds); mainCanvasPane.MoveMouseToCenter(); MouseUp(); // Open Effects page and cycle through the different (lighting) Effects var effectsButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "Effects",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); effectsButton.Click(); var defaultThemeButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "Default",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); defaultThemeButton.Click(); Wait(globalIntermittentWaitInSeconds); MainWindow.Type("{right}".Repeat(4) + "{down}" + "{left}".Repeat(4) + "{down}" + "{right}".Repeat(4) + "{down}"+ "{left}".Repeat(4) + "{down}" + "{right}", cpm:globalCharactersPerMinuteToTypeThemeChange,hideInLogging:false); // This cycles through the different effects Wait(globalIntermittentWaitInSeconds); defaultThemeButton.Click(); // *Note an internet connection is needed for the following to work* // Open 3D library page, ensure it loads, open Latest 3D Collections page, ensure it loads, committing/adding the top-left model in the Latest 3D Collections page, ensure it draws, and moving it back and forth in 3D space var threeDLibraryButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "3D library",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); threeDLibraryButton.Click(); var latest3DCollectionsButton = MainWindow.FindControl(className : "ListItem:GridViewItem", title : "Latest 3D collections",timeout:globalFunctionTimeoutInSeconds); // Find and click on Latest 3D collections button Wait(globalIntermittentWaitInSeconds); latest3DCollectionsButton.Click(); MainWindow.FindControl(className : "Text:TextBlock", title : "Latest 3D collections", text : "Latest 3D collections",timeout:globalFunctionTimeoutInSeconds); // Locating this ensures the Latest 3D collection pane has loaded Wait(globalIntermittentWaitInSeconds); var topLeftLatest3DCollectionsButton = MainWindow.FindControlWithXPath(xPath : "Xaml Window:Windows.UI.Core.CoreWindow/Pane/List:GridView/ListItem:GridViewItem",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); topLeftLatest3DCollectionsButton.Click(); // Find and click on the top left selection in the loaded pane var zAxisPositionButton3DLibrary = MainWindow.FindControl(className : "Group:NamedContainerAutomationPeer", title : "Z-axis position",timeout:globalFunctionTimeoutInSeconds); Wait(globalIntermittentWaitInSeconds); zAxisPositionButton3DLibrary.MoveMouseToCenter(); Wait(globalIntermittentWaitInSeconds); MouseDown(); MouseMove(1,1); Wait(globalIntermittentWaitInSeconds); mainCanvasPane.MoveMouseToCenter(); MouseUp(); // Zoom into the canvas all the way, reset the view, zoom out of the canvas all the way, then reset the view MainWindow.Type("{pageup}".Repeat(10) + "{home}" + "{pagedown}".Repeat(6) + "{home}",cpm:globalCharactersPerMinuteToTypeZooming,hideInLogging:false); // This will close out of the Paint 3D app ShellExecute(@"cmd /c taskkill /f /im ApplicationFrameHost.ex*",timeout:globalFunctionTimeoutInSeconds,forceKillOnExit:true,waitForProcessEnd:true); // Close out of the 3D Viewer app } }