-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (31 loc) · 1.03 KB
/
main.py
File metadata and controls
38 lines (31 loc) · 1.03 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
from selenium import webdriver
HOST = "localhost"
# get google title with VNC session from Firefox browser
def test_firefox():
capabilities = {
"browserName": "firefox",
"version": "72.0",
"enableVNC": False,
"enableVideo": False
}
firefox = webdriver.Remote(command_executor='http://{}:4444/wd/hub'.format(HOST),
desired_capabilities=capabilities)
firefox.get('https://www.google.com')
print('firefox', firefox.title)
firefox.quit()
# get google title with VNC session from Chrome browser
def test_chrome():
capabilities = {
"browserName": "chrome",
"version": "80.0_VNC",
"enableVNC": True,
"enableVideo": False
}
chrome = webdriver.Remote(command_executor='http://{}:4444/wd/hub'.format(HOST),
desired_capabilities=capabilities)
chrome.get('https://www.google.com')
print('chrome', chrome.title)
chrome.quit()
if __name__ == "__main__":
test_firefox()
test_chrome()