28
28
DEFAULT_HOST = None
29
29
DEFAULT_LOG_LEVEL = None
30
30
DEFAULT_SERVICE_LOG_PATH = None
31
+ DEFAULT_KEEP_ALIVE = None
31
32
32
33
33
34
class WebDriver (RemoteWebDriver ):
@@ -37,7 +38,7 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
37
38
port = DEFAULT_PORT , timeout = DEFAULT_TIMEOUT , host = DEFAULT_HOST ,
38
39
log_level = DEFAULT_LOG_LEVEL , service_log_path = DEFAULT_SERVICE_LOG_PATH ,
39
40
options : Options = None , service : Service = None ,
40
- desired_capabilities = None , keep_alive = False ):
41
+ desired_capabilities = None , keep_alive = DEFAULT_KEEP_ALIVE ):
41
42
"""
42
43
Creates a new instance of the Ie driver.
43
44
@@ -53,7 +54,7 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
53
54
- service_log_path - Deprecated: target of logging of service, may be "stdout", "stderr" or file path.
54
55
- options - IE Options instance, providing additional IE options
55
56
- desired_capabilities - Deprecated: alias of capabilities; this will make the signature consistent with RemoteWebDriver.
56
- - keep_alive - Whether to configure RemoteConnection to use HTTP keep-alive.
57
+ - keep_alive - Deprecated: Whether to configure RemoteConnection to use HTTP keep-alive.
57
58
"""
58
59
if executable_path != 'IEDriverServer.exe' :
59
60
warnings .warn ('executable_path has been deprecated, please pass in a Service object' ,
@@ -70,13 +71,22 @@ def __init__(self, executable_path='IEDriverServer.exe', capabilities=None,
70
71
if host != DEFAULT_HOST :
71
72
warnings .warn ('host has been deprecated, please pass in a Service object' ,
72
73
DeprecationWarning , stacklevel = 2 )
73
- self .host = host
74
74
if log_level != DEFAULT_LOG_LEVEL :
75
75
warnings .warn ('log_level has been deprecated, please pass in a Service object' ,
76
76
DeprecationWarning , stacklevel = 2 )
77
77
if service_log_path != DEFAULT_SERVICE_LOG_PATH :
78
78
warnings .warn ('service_log_path has been deprecated, please pass in a Service object' ,
79
79
DeprecationWarning , stacklevel = 2 )
80
+ if desired_capabilities :
81
+ warnings .warn ('desired_capabilities has been deprecated, please pass in a Service object' ,
82
+ DeprecationWarning , stacklevel = 2 )
83
+ if keep_alive != DEFAULT_KEEP_ALIVE :
84
+ warnings .warn ('keep_alive has been deprecated, please pass in a Service object' ,
85
+ DeprecationWarning , stacklevel = 2 )
86
+ else :
87
+ keep_alive = False
88
+
89
+ self .host = host
80
90
self .port = port
81
91
if self .port == 0 :
82
92
self .port = utils .free_port ()
0 commit comments