March 12, 2018
UI Automation | Basic Script | Calculator
Below is the sample script for automating the calculator application on Windows 10. The script launches the calculator and clicks on 2, 3 and 4 number buttons.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 'Describe the object properties oWindow = "Window,Name::Calculator" oTwo = "Window,Name::Calculator>==>Button,Name::Two" oThree = "Window,Name::Calculator>==>Button,Name::Three" oFour = "Window,Name::Calculator>==>Button,Name::Four" 'Open Calculator App Set oShell = CreateObject("Wscript.shell") oShell.Run "Calc" 'Wait for Window to show up bSync = uia.Exist(oWindow) util.Wait(1) 'Click on 2,3,4 buttons uia.Click oTwo uia.Click oThree uia.Click oFour |
3 Comments
Where is uia defined?
uia is reserved object to automate win32, .net, WPF etc applications.
Here is a sample for step by step automation http://thetestmate.com/desktop-automation-step-step/
http://thetestmate.com/chapter-2-reserved-objects/