Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 5 additions & 24 deletions py/selenium/webdriver/webkitgtk/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver

from .options import Options
from .service import DEFAULT_EXECUTABLE_PATH
from .service import Service


Expand All @@ -30,42 +29,24 @@ class WebDriver(RemoteWebDriver):

def __init__(
self,
executable_path=DEFAULT_EXECUTABLE_PATH,
port=0,
options=None,
desired_capabilities=None,
service_log_path=None,
keep_alive=False,
service: Service = None,
):
"""Creates a new instance of the WebKitGTK driver.

Starts the service and then creates new instance of WebKitGTK Driver.

:Args:
- executable_path : path to the executable. If the default is used it assumes the executable is in the $PATH.
- port : port you would like the service to run, if left as 0, a free port will be found.
- options : an instance of WebKitGTKOptions
- desired_capabilities : Dictionary object with desired capabilities
- service_log_path : Path to write service stdout and stderr output.
- keep_alive : Whether to configure RemoteConnection to use HTTP keep-alive.
- service : Service object for handling the browser driver if you need to pass extra details
"""
if not options:
options = Options()
if not desired_capabilities:
desired_capabilities = options.to_capabilities()
else:
capabilities = options.to_capabilities()
if desired_capabilities:
capabilities.update(desired_capabilities)
desired_capabilities = capabilities

self.service = Service(executable_path, port=port, log_path=service_log_path)
options = options if options else Options()
self.service = service if service else Service()
self.service.path = DriverFinder(self.service, options).get_driver_path()
self.service.start()

super().__init__(
command_executor=self.service.service_url, desired_capabilities=desired_capabilities, keep_alive=keep_alive
)
super().__init__(command_executor=self.service.service_url, options=options)
self._is_remote = False

def quit(self):
Expand Down
3 changes: 1 addition & 2 deletions py/selenium/webdriver/wpewebkit/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ def __init__(
- options : an instance of ``WPEWebKitOptions``
- service : Service object for handling the browser driver if you need to pass extra details
"""
if not options:
options = Options()

options = options if options else Options()
self.service = service if service else Service()
self.service.path = DriverFinder(self.service, options).get_driver_path()
self.service.start()
Expand Down