Skip to content

Commit

Permalink
docs: webdriver: update code for selenium 4
Browse files Browse the repository at this point in the history
The desired_capabilities property has been deprecated in Selenium 4.0
Alpha 7 and dropped in Selenium 4.17.0.

Use options.capabilities instead.
  • Loading branch information
Jonas Rebmann authored and aperezdc committed Dec 2, 2024
1 parent b59d3a3 commit ad08d81
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions docs/webdriver.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,15 @@ In the python script:
```python
from selenium import webdriver

def capabilities():
return {
"wpe:browserOptions": {
"binary": "/usr/bin/cog",
"args": ["--automation", "--platform=wl"],
}
}
options = webdriver.WPEWebKitOptions()
options.capabilities.clear()
options.binary_location = "/usr/bin/cog"
options.add_argument("--automation")
options.add_argument("--platform=wl")

driver = webdriver.Remote(
command_executor="http://YOUR_DEVICE_IP:8088",
desired_capabilities=capabilities(),
options=options,
)
```

Expand All @@ -63,4 +61,4 @@ pointer = actions.pointer_action
pointer.move_to(board, x, y)
pointer.click()
actions.perform()
```
```

0 comments on commit ad08d81

Please sign in to comment.