-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestOpenFin.py
More file actions
32 lines (21 loc) · 924 Bytes
/
testOpenFin.py
File metadata and controls
32 lines (21 loc) · 924 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
32
import time
from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
chrome_options.binary_location = ".\RunOpenFin.bat"
chrome_options.add_argument("--config=http://localhost:8080/app.json")
EXE_PATH = r'.\chromedriver.exe'
driver = webdriver.Chrome(executable_path=EXE_PATH,chrome_options=chrome_options)
openfin_version = driver.execute_script("return fin.desktop.getVersion()")
print("OpenFin Runtime Version: " + openfin_version)
notification_button = driver.find_element_by_id("desktop-notification")
notification_button.click()
cpu_info_button = driver.find_element_by_id("cpu-info")
cpu_info_button.click()
cpu_window = driver.switch_to.window("cpuChild")
driver.save_screenshot("showCPUInfo.png")
time.sleep(2)
cpu_window_close_button = driver.find_element_by_id("close-app")
cpu_window_close_button.click()
driver.execute_script("fin.desktop.System.exit()")
time.sleep(2)
driver.quit()