-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogon_Automation.py
More file actions
31 lines (26 loc) · 825 Bytes
/
logon_Automation.py
File metadata and controls
31 lines (26 loc) · 825 Bytes
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
from tnz.ati import ati
ati.set("TRACE", "ALL")
ati.set("LOGDEST", "example.log")
ati.set("ONERROR", "1")
ati.set("DISPLAY", "HOST")
ati.set("SESSION_HOST", "198.212.158.145")
ati.set("SESSION", "A")
ati.wait(lambda: ati.scrhas("ENTER APPLICATION: "))
ati.send("LOGON APPLID(TSO)[enter]")
ati.wait(lambda: ati.scrhas("ENTER USERID - "))
ati.send("TOPYH[enter]")
ati.wait(lambda: ati.scrhas("Password ===> "))
ati.send("Zaq@edC2[enter]")
# maybe look for a status message
ati.wait(lambda: ati.scrhas("ICH70001I"))
ati.send("[enter]")
# do something useful
ati.wait(lambda: ati.scrhas("***"))
ati.send("[enter]")
ati.wait(lambda: ati.scrhas("Menu"))
ati.send("x[enter]")
ati.wait(lambda: ati.scrhas("READY"))
ati.send("logon[enter]")
ati.wait(lambda: ati.scrhas("LOGGED OFF"))
# disconnect from host
ati.drop("SESSION")