-
Notifications
You must be signed in to change notification settings - Fork 35
/
testSikulix4python.py
46 lines (33 loc) · 1018 Bytes
/
testSikulix4python.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# https://www.python.org should be opened in Safari
# build the bridge to SikuliX
from sikulix4python import *
# reset the state of SikuliX
# only needed, but recommended in main script
reset()
#print(sxClassHelp("Region")); exit()
#hover(100,100); exit()
reg = Region()
print(reg)
reg.setX(100).setW(300)
print(reg)
hover()
hover(reg)
exit()
# make images available in the folder of the script
addImagePath()
switchApp("Safari")
hover() # undotted uses SCREEN object (sxundotted)
scr = Screen()
# getCenter() is found auto-magically,
# though not defined in the Python class Screen
# see sxclasses::__getattr__
# one gets method missing, if signatures do not fit
scr.getCenter().grow(100).highlight(2)
img = "img.png" # located via ImagePath
# a Match object is completely handled at the Java level
# not defined at the Python level
match = scr.exists(img, 3) # method missing, wrong signature
match = scr.exists(img, 3.0) # number must be float/double
if match:
match.highlight(2)
match.click()