-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain1.py
36 lines (33 loc) · 1.33 KB
/
main1.py
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
from selene.support.shared import browser, config
from selenium.webdriver import Chrome
import selenium.webdriver
if __name__ == '__main__':
config.browser_name = 'chrome'
config.base_url = "http://k8s.testing-studio.com:5444"
config.timeout = 10
config.save_screenshot_on_failure = False
option = selenium.webdriver.ChromeOptions()
option.add_argument("--disable-infobars")
option.add_argument("--disable-dev-shm-usage")
option.add_argument("--no-sandbox")
option.add_argument("--disable-extensions")
option.add_argument("--ignore-ssl-errors")
option.add_argument("--ignore-certificate-errors")
option.add_argument('--disable-gpu')
prefs = {'download.default_directory': '/home/seluser/Downloads/'}
option.add_experimental_option('prefs', prefs)
option.add_experimental_option('w3c', False)
option.add_experimental_option('perfLoggingPrefs', {
'enableNetwork': True,
'enablePage': False,
})
caps = option.to_capabilities()
caps['goog:loggingPrefs'] = {'performance': 'ALL'}
config.driver = selenium.webdriver.Remote(
command_executor="http://k8s.testing-studio.com:5444",
desired_capabilities=caps,
keep_alive=True,
options=option)
config.driver.set_page_load_timeout(10)
browser.open('/')
browser.driver.maximize_window()