Importing engine module import engine Adding global variables ATIH_PAT

 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
# Importing 'engine' module
import engine
# Adding global variables:
ATIH_PATH = engine.macro.ProgramFiles_x86 + r"\Acronis\TrueImageHome\TrueImage.exe"
ATIH_TITLE = "[REGEXPTITLE:Acronis.True.Image]"
ATIH_BACKUP_WIZARD_TITLE = "[CLASS:ArchiveWizard]"
# Create new 'engine' object
myTC = engine(logfile = r".\results.log")
# Creating new 'application' and 'window' objects:
atih = myTC.application(ATIH_PATH)
atih_main_window = atih.window(title = ATIH_TITLE)
atih_backup_wizard_window = atih.window(title = ATIH_BACKUP_WIZARD_TITLE)
# Run created application and wait for main window to appear
atih_pid = atih.run(wait = False, show = engine.MAXIMIZE)
atih_main_window.wait(60)
# Run Backup wizard window and create its screen shot, then close it
atih_main_window.click(x = 445, y = 322)
atih_main_window.click(image = r".\extra\mydiskdrives.png", click = 1, button = "left", timeout = 60)
atih_backup_wizard_window.wait(60)
atih_backup_wizard_window.capture(filename = ".\screenshots\backup_wiz.png")
atih_backup_wizard_window.close()
atih_main_window.close()
# Exit
myTC.exit(0)