From 0c66503e272c9c7c7fd6faa24b62bcce4382b6c6 Mon Sep 17 00:00:00 2001 From: francisco souza <108725+fsouza@users.noreply.github.com> Date: Wed, 15 Nov 2023 08:28:06 -0500 Subject: [PATCH] docs/drivers/remote: fix desired capabilities Closes #1213. --- docs/drivers/remote.rst | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/drivers/remote.rst b/docs/drivers/remote.rst index 4339ccc61..729e047c4 100644 --- a/docs/drivers/remote.rst +++ b/docs/drivers/remote.rst @@ -37,9 +37,18 @@ browser instance running on Windows 11. .. code-block:: python + from selenium.webdriver.chrome.options import Options + from splinter import Browser + # Specify the server URL remote_server_url = 'http://YOUR_LT_USERNAME:YOUR_LT_ACCESS_KEY@@hub.lambdatest.com/wd/hub' + # Configure desired capabilities + options = Options() + options.set_capability('platform', 'Windows 11') + options.set_capability('version', '99.0') + options.set_capability('name', 'Test of Chrome 99 on WINDOWS') + with Browser( driver_name="remote", browser='Chrome', @@ -57,26 +66,27 @@ browser instance running on Windows 11. - The following example uses `Sauce Labs`_ (a company that provides Selenium Remote WebDriver servers as a service) to request an Internet Explorer 9 browser instance running on Windows 7. .. code-block:: python + from selenium.webdriver.ie.options import Options + from splinter import Browser + # Specify the server URL remote_server_url = 'http://YOUR_SAUCE_USERNAME:YOUR_SAUCE_ACCESS_KEY@ondemand.saucelabs.com:80/wd/hub' + options = Options() + options.set_capability('platform', 'Windows 7') + options.set_capability('version', '9') + options.set_capability('name', 'Test of IE 9 on WINDOWS') with Browser( driver_name="remote", browser='internetexplorer', command_executor=remote_server_url, - desired_capabilities = { - 'platform': 'Windows 7', - 'version': '9', - 'name': 'Test of IE 9 on WINDOWS', - }, - keep_alive=True, + options=options, ) as browser: print("Link to job: https://saucelabs.com/jobs/{}".format( browser.driver.session_id))