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

Add a Comment

Your email address will not be published. Required fields are marked *