-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.py
More file actions
58 lines (51 loc) · 2.05 KB
/
test.py
File metadata and controls
58 lines (51 loc) · 2.05 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
# Impoting Pyautogui library to control the actions for your programme
import pyautogui
import time
import pickle
from firebase import firebase
#Confirming already saved chrome png is working or not
firebase = firebase.FirebaseApplication('https://sleep-tight-8a6df.firebaseio.com/', None)
id2 = pickle.load(open("chrome","rb"))
X = firebase.get('/sleep-tight-8a6df/Chrome/'+ str(id2) , 'CX' )
Y = firebase.get('/sleep-tight-8a6df/Chrome/'+ str(id2) , 'CY' )
pyautogui.click(X, Y)
time.sleep(8)
pyautogui.write('https://cuchd.blackboard.com')
time.sleep(1)
pyautogui.keyDown('enter')
pyautogui.alert('After clicking ok move your mouse on signin and wait for another prompt.')
time.sleep(4)
currentMouseX, currentMouseY = pyautogui.position()
pyautogui.alert('Done!!!')
data = {
'SX': currentMouseX,
'SY': currentMouseY
}
result = firebase.post('/sleep-tight-8a6df/signin/',data)
final = ''.join(key + str(val) for key, val in result.items())
data = str(final)
proxy = data[4:24]
pickle.dump(proxy, open("sign","wb"))
pyautogui.alert('Now Run sometest.py using the command given in github README.md file.')
"""
if str(work_var) == 'YES':
pyautogui.write('https://cuchd.blackboard.com')
pyautogui.keyDown('enter')
working = pyautogui.confirm('Does your blackboard started', buttons=['YES', 'NO']) if str(working) == 'YES':
id = pickle.load(open("name","rb"))
email = firebase.get('/sleep-tight-8a6df/Students/'+ str(id) , 'Name' )
pyautogui.write(email)
password = firebase.get('/sleep-tight-8a6df/Students/'+ str(id) , 'RollNo' )
pyautogui.keyDown('tab')
pyautogui.write(password)
pyautogui.keyDown('enter')
pyautogui.alert('Your test file ends here')
else:
pyautogui.alert('Please pin chrome to taskbar and run the Programme.')
else:
check = pyautogui.confirm('Is your chrome pinned to taskbar?', buttons=['YES', 'NO'])
if str(check) == 'YES':
print("okk")
else:
pyautogui.alert('Please pin chrome to taskbar and run the Programme once again.')
"""