Skip to content

Commit c69d567

Browse files
authored
Merge pull request #167 from mdpdesign/add-chrome-driver-kwargs-example
Add Splinter driver kwargs Chrome example override
2 parents 47141cd + 57a1c1d commit c69d567

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,26 @@ Fixtures
147147
"""
148148
return {"service_log_path": Path("/log/directory/geckodriver.log")}
149149
150+
The snippet below configures Chrome to ignore certificate errors and sets a specific window size
151+
152+
.. code-block:: python
153+
154+
import pytest
155+
from selenium import webdriver
156+
157+
@pytest.fixture(scope='session')
158+
def splinter_driver_kwargs():
159+
"""Override Chrome WebDriver options"""
160+
chrome_options = webdriver.ChromeOptions()
161+
162+
# List of Chromium Command Line Switches
163+
# https://peter.sh/experiments/chromium-command-line-switches/
164+
chrome_options.add_argument("--window-size=1440,1200")
165+
chrome_options.add_argument("--ignore-ssl-errors=yes")
166+
chrome_options.add_argument("--ignore-certificate-errors")
167+
168+
return {"options": chrome_options}
169+
150170
* splinter_window_size
151171
Size of the browser window on browser initialization. Tuple in form (<width>, <height>). Default is (1366, 768)
152172

0 commit comments

Comments
 (0)