Posts Tagged ‘tip’
Tip of the day: setting the size of browser’s window
Sometimes, you need to set a window to a particular size. Not a problem, in the one-liner below we start Firefox and set height and width:
Start-SeFirefox | ConvertTo-SeAutomationElement | Invoke-UIAWindowTransformResize -TransformResizeWidth 500 -TransformResizeHeight 200;
Tip of the day: using wildcards in UIAutomation
One of amazing features of PowerShell cmdlets is supporting so-called wildcards. What are wildcards? The characters that substitute one or more, or even all of the characters in the string.
For example, you need to simplify your code:Start-Process calc -PassThru | Get-UIAWindow | Get-UIAButton -Name a* | Invoke-UIAButtonClick;This code presses the plus button, the button that is named Add.
Imagine that you need to press the Reciprocal button and you’ll immediately love wildcards.

