Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eda1ecc

Browse files
authored
Update: 2.5 Using Selenium with remote WebDriver (baijum#108)
The desired_capabilities has been deprecated. Use Options instead of DesiredCapabilities.
1 parent 54fcbcc commit eda1ecc

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

source/getting-started.rst

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -259,25 +259,13 @@ The above line says that you can use this URL for connecting to the remote
259259
WebDriver. Here are some examples::
260260

261261
from selenium import webdriver
262-
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
263262

264263
driver = webdriver.Remote(
265264
command_executor='http://127.0.0.1:4444/wd/hub',
266-
desired_capabilities=DesiredCapabilities.CHROME)
265+
options=webdriver.ChromeOptions()
266+
)
267267

268268
driver = webdriver.Remote(
269269
command_executor='http://127.0.0.1:4444/wd/hub',
270-
desired_capabilities=DesiredCapabilities.OPERA)
271-
272-
driver = webdriver.Remote(
273-
command_executor='http://127.0.0.1:4444/wd/hub',
274-
desired_capabilities=DesiredCapabilities.HTMLUNITWITHJS)
275-
276-
The desired capabilities is a dictionary. So instead of using the default
277-
dictionaries, you can specify the values explicitly::
278-
279-
driver = webdriver.Remote(
280-
command_executor='http://127.0.0.1:4444/wd/hub',
281-
desired_capabilities={'browserName': 'htmlunit',
282-
'version': '2',
283-
'javascriptEnabled': True})
270+
options=webdriver.FirefoxOptions()
271+
)

0 commit comments

Comments
 (0)