Skip to content

Commit

Permalink
Update: 2.5 Using Selenium with remote WebDriver (#108)
Browse files Browse the repository at this point in the history
The desired_capabilities has been deprecated.
Use Options instead of DesiredCapabilities.
  • Loading branch information
amosctlee authored Sep 25, 2022
1 parent 54fcbcc commit eda1ecc
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions source/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,25 +259,13 @@ The above line says that you can use this URL for connecting to the remote
WebDriver. Here are some examples::

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.CHROME)
options=webdriver.ChromeOptions()
)

driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.OPERA)

driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities=DesiredCapabilities.HTMLUNITWITHJS)

The desired capabilities is a dictionary. So instead of using the default
dictionaries, you can specify the values explicitly::

driver = webdriver.Remote(
command_executor='http://127.0.0.1:4444/wd/hub',
desired_capabilities={'browserName': 'htmlunit',
'version': '2',
'javascriptEnabled': True})
options=webdriver.FirefoxOptions()
)

0 comments on commit eda1ecc

Please sign in to comment.