seleniumbase 4.24.10__py3-none-any.whl → 4.33.15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sbase/__init__.py +1 -0
- sbase/steps.py +7 -0
- seleniumbase/__init__.py +16 -7
- seleniumbase/__version__.py +1 -1
- seleniumbase/behave/behave_sb.py +97 -32
- seleniumbase/common/decorators.py +16 -7
- seleniumbase/config/proxy_list.py +3 -3
- seleniumbase/config/settings.py +4 -0
- seleniumbase/console_scripts/logo_helper.py +47 -8
- seleniumbase/console_scripts/run.py +345 -335
- seleniumbase/console_scripts/sb_behave_gui.py +5 -12
- seleniumbase/console_scripts/sb_caseplans.py +6 -13
- seleniumbase/console_scripts/sb_commander.py +5 -12
- seleniumbase/console_scripts/sb_install.py +62 -54
- seleniumbase/console_scripts/sb_mkchart.py +13 -20
- seleniumbase/console_scripts/sb_mkdir.py +11 -17
- seleniumbase/console_scripts/sb_mkfile.py +69 -43
- seleniumbase/console_scripts/sb_mkpres.py +13 -20
- seleniumbase/console_scripts/sb_mkrec.py +88 -21
- seleniumbase/console_scripts/sb_objectify.py +30 -30
- seleniumbase/console_scripts/sb_print.py +5 -12
- seleniumbase/console_scripts/sb_recorder.py +16 -11
- seleniumbase/core/browser_launcher.py +1658 -221
- seleniumbase/core/detect_b_ver.py +7 -8
- seleniumbase/core/log_helper.py +42 -27
- seleniumbase/core/mysql.py +1 -4
- seleniumbase/core/proxy_helper.py +35 -30
- seleniumbase/core/recorder_helper.py +24 -5
- seleniumbase/core/sb_cdp.py +1951 -0
- seleniumbase/core/sb_driver.py +162 -8
- seleniumbase/core/settings_parser.py +6 -0
- seleniumbase/core/style_sheet.py +10 -0
- seleniumbase/extensions/recorder.zip +0 -0
- seleniumbase/fixtures/base_case.py +1234 -632
- seleniumbase/fixtures/constants.py +10 -1
- seleniumbase/fixtures/js_utils.py +171 -144
- seleniumbase/fixtures/page_actions.py +177 -13
- seleniumbase/fixtures/page_utils.py +25 -53
- seleniumbase/fixtures/shared_utils.py +97 -11
- seleniumbase/js_code/active_css_js.py +1 -1
- seleniumbase/js_code/recorder_js.py +1 -1
- seleniumbase/plugins/base_plugin.py +2 -3
- seleniumbase/plugins/driver_manager.py +340 -65
- seleniumbase/plugins/pytest_plugin.py +276 -47
- seleniumbase/plugins/sb_manager.py +412 -99
- seleniumbase/plugins/selenium_plugin.py +122 -17
- seleniumbase/translate/translator.py +0 -7
- seleniumbase/undetected/__init__.py +59 -52
- seleniumbase/undetected/cdp.py +0 -1
- seleniumbase/undetected/cdp_driver/__init__.py +1 -0
- seleniumbase/undetected/cdp_driver/_contradict.py +110 -0
- seleniumbase/undetected/cdp_driver/browser.py +829 -0
- seleniumbase/undetected/cdp_driver/cdp_util.py +458 -0
- seleniumbase/undetected/cdp_driver/config.py +334 -0
- seleniumbase/undetected/cdp_driver/connection.py +639 -0
- seleniumbase/undetected/cdp_driver/element.py +1168 -0
- seleniumbase/undetected/cdp_driver/tab.py +1323 -0
- seleniumbase/undetected/dprocess.py +4 -7
- seleniumbase/undetected/options.py +6 -8
- seleniumbase/undetected/patcher.py +11 -13
- seleniumbase/undetected/reactor.py +0 -1
- seleniumbase/undetected/webelement.py +16 -3
- {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/LICENSE +1 -1
- {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/METADATA +299 -252
- {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/RECORD +68 -70
- {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/WHEEL +1 -1
- sbase/ReadMe.txt +0 -2
- seleniumbase/ReadMe.md +0 -25
- seleniumbase/common/ReadMe.md +0 -71
- seleniumbase/console_scripts/ReadMe.md +0 -731
- seleniumbase/drivers/ReadMe.md +0 -27
- seleniumbase/extensions/ReadMe.md +0 -12
- seleniumbase/masterqa/ReadMe.md +0 -61
- seleniumbase/resources/ReadMe.md +0 -31
- seleniumbase/resources/favicon.ico +0 -0
- seleniumbase/utilities/selenium_grid/ReadMe.md +0 -84
- seleniumbase/utilities/selenium_ide/ReadMe.md +0 -111
- {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/entry_points.txt +0 -0
- {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/top_level.txt +0 -0
@@ -1,18 +1,20 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: seleniumbase
|
3
|
-
Version: 4.
|
3
|
+
Version: 4.33.15
|
4
4
|
Summary: A complete web automation framework for end-to-end testing.
|
5
5
|
Home-page: https://github.com/seleniumbase/SeleniumBase
|
6
6
|
Author: Michael Mintz
|
7
7
|
Author-email: mdmintz@gmail.com
|
8
8
|
Maintainer: Michael Mintz
|
9
9
|
License: MIT
|
10
|
+
Project-URL: Homepage, https://github.com/seleniumbase/SeleniumBase
|
10
11
|
Project-URL: Changelog, https://github.com/seleniumbase/SeleniumBase/releases
|
11
12
|
Project-URL: Download, https://pypi.org/project/seleniumbase/#files
|
12
|
-
Project-URL: Gitter, https://gitter.im/seleniumbase/SeleniumBase
|
13
13
|
Project-URL: Blog, https://seleniumbase.com/
|
14
|
+
Project-URL: Discord, https://discord.gg/EdhQTn3EyE
|
14
15
|
Project-URL: PyPI, https://pypi.org/project/seleniumbase/
|
15
16
|
Project-URL: Source, https://github.com/seleniumbase/SeleniumBase
|
17
|
+
Project-URL: Repository, https://github.com/seleniumbase/SeleniumBase
|
16
18
|
Project-URL: Documentation, https://seleniumbase.io/
|
17
19
|
Keywords: pytest,selenium,framework,automation,browser,testing,webdriver,seleniumbase,sbase,crawling,scraping
|
18
20
|
Platform: Windows
|
@@ -32,7 +34,6 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
32
34
|
Classifier: Operating System :: POSIX :: Linux
|
33
35
|
Classifier: Programming Language :: Python
|
34
36
|
Classifier: Programming Language :: Python :: 3
|
35
|
-
Classifier: Programming Language :: Python :: 3.7
|
36
37
|
Classifier: Programming Language :: Python :: 3.8
|
37
38
|
Classifier: Programming Language :: Python :: 3.9
|
38
39
|
Classifier: Programming Language :: Python :: 3.10
|
@@ -55,161 +56,185 @@ Classifier: Topic :: Software Development :: Testing
|
|
55
56
|
Classifier: Topic :: Software Development :: Testing :: Acceptance
|
56
57
|
Classifier: Topic :: Software Development :: Testing :: Traffic Generation
|
57
58
|
Classifier: Topic :: Utilities
|
58
|
-
Requires-Python: >=3.
|
59
|
+
Requires-Python: >=3.8
|
59
60
|
Description-Content-Type: text/markdown
|
60
61
|
License-File: LICENSE
|
61
|
-
Requires-Dist: pip
|
62
|
-
Requires-Dist: packaging
|
63
|
-
Requires-Dist:
|
64
|
-
Requires-Dist:
|
65
|
-
Requires-Dist:
|
66
|
-
Requires-Dist:
|
67
|
-
Requires-Dist:
|
68
|
-
Requires-Dist:
|
69
|
-
Requires-Dist:
|
70
|
-
Requires-Dist:
|
71
|
-
Requires-Dist:
|
72
|
-
Requires-Dist:
|
73
|
-
Requires-Dist:
|
74
|
-
Requires-Dist:
|
75
|
-
Requires-Dist:
|
76
|
-
Requires-Dist:
|
77
|
-
Requires-Dist:
|
78
|
-
Requires-Dist:
|
79
|
-
Requires-Dist:
|
80
|
-
Requires-Dist:
|
81
|
-
Requires-Dist:
|
82
|
-
Requires-Dist:
|
83
|
-
Requires-Dist:
|
84
|
-
Requires-Dist:
|
85
|
-
Requires-Dist:
|
86
|
-
Requires-Dist:
|
87
|
-
Requires-Dist:
|
88
|
-
Requires-Dist:
|
89
|
-
Requires-Dist:
|
90
|
-
Requires-Dist:
|
91
|
-
Requires-Dist:
|
92
|
-
Requires-Dist:
|
93
|
-
Requires-Dist:
|
94
|
-
Requires-Dist:
|
95
|
-
Requires-Dist:
|
96
|
-
Requires-Dist:
|
97
|
-
Requires-Dist:
|
98
|
-
Requires-Dist:
|
99
|
-
Requires-Dist:
|
100
|
-
Requires-Dist:
|
101
|
-
Requires-Dist:
|
102
|
-
Requires-Dist:
|
103
|
-
Requires-Dist:
|
104
|
-
Requires-Dist:
|
105
|
-
Requires-Dist:
|
106
|
-
Requires-Dist:
|
107
|
-
Requires-Dist:
|
108
|
-
Requires-Dist:
|
109
|
-
Requires-Dist:
|
110
|
-
Requires-Dist: pytest
|
111
|
-
Requires-Dist: pytest-
|
112
|
-
Requires-Dist:
|
113
|
-
Requires-Dist:
|
114
|
-
Requires-Dist:
|
115
|
-
Requires-Dist:
|
116
|
-
Requires-Dist:
|
117
|
-
Requires-Dist:
|
118
|
-
Requires-Dist:
|
119
|
-
Requires-Dist:
|
120
|
-
Requires-Dist:
|
121
|
-
Requires-Dist:
|
122
|
-
Requires-Dist:
|
123
|
-
Requires-Dist:
|
124
|
-
Requires-Dist:
|
125
|
-
Requires-Dist:
|
126
|
-
Requires-Dist: soupsieve ==2.5 ; python_version >= "3.8"
|
127
|
-
Requires-Dist: markdown-it-py ==3.0.0 ; python_version >= "3.8"
|
62
|
+
Requires-Dist: pip>=24.3.1
|
63
|
+
Requires-Dist: packaging>=24.2
|
64
|
+
Requires-Dist: setuptools~=70.2; python_version < "3.10"
|
65
|
+
Requires-Dist: setuptools>=75.8.0; python_version >= "3.10"
|
66
|
+
Requires-Dist: wheel>=0.45.1
|
67
|
+
Requires-Dist: attrs>=24.3.0
|
68
|
+
Requires-Dist: certifi>=2024.12.14
|
69
|
+
Requires-Dist: exceptiongroup>=1.2.2
|
70
|
+
Requires-Dist: websockets~=13.1; python_version < "3.9"
|
71
|
+
Requires-Dist: websockets>=14.1; python_version >= "3.9"
|
72
|
+
Requires-Dist: filelock>=3.16.1
|
73
|
+
Requires-Dist: fasteners>=0.19
|
74
|
+
Requires-Dist: mycdp>=1.1.0
|
75
|
+
Requires-Dist: pynose>=1.5.3
|
76
|
+
Requires-Dist: platformdirs>=4.3.6
|
77
|
+
Requires-Dist: typing-extensions>=4.12.2
|
78
|
+
Requires-Dist: sbvirtualdisplay>=1.4.0
|
79
|
+
Requires-Dist: MarkupSafe==2.1.5; python_version < "3.9"
|
80
|
+
Requires-Dist: MarkupSafe>=3.0.2; python_version >= "3.9"
|
81
|
+
Requires-Dist: Jinja2>=3.1.5
|
82
|
+
Requires-Dist: six>=1.17.0
|
83
|
+
Requires-Dist: parse>=1.20.2
|
84
|
+
Requires-Dist: parse-type>=0.6.4
|
85
|
+
Requires-Dist: colorama>=0.4.6
|
86
|
+
Requires-Dist: pyyaml>=6.0.2
|
87
|
+
Requires-Dist: pygments>=2.19.1
|
88
|
+
Requires-Dist: pyreadline3>=3.5.3; platform_system == "Windows"
|
89
|
+
Requires-Dist: tabcompleter>=1.4.0
|
90
|
+
Requires-Dist: pdbp>=1.6.1
|
91
|
+
Requires-Dist: idna==3.10
|
92
|
+
Requires-Dist: chardet==5.2.0
|
93
|
+
Requires-Dist: charset-normalizer==3.4.1
|
94
|
+
Requires-Dist: urllib3<2,>=1.26.20; python_version < "3.10"
|
95
|
+
Requires-Dist: urllib3<2.4.0,>=1.26.20; python_version >= "3.10"
|
96
|
+
Requires-Dist: requests==2.32.3
|
97
|
+
Requires-Dist: sniffio==1.3.1
|
98
|
+
Requires-Dist: h11==0.14.0
|
99
|
+
Requires-Dist: outcome==1.3.0.post0
|
100
|
+
Requires-Dist: trio==0.27.0; python_version < "3.9"
|
101
|
+
Requires-Dist: trio==0.28.0; python_version >= "3.9"
|
102
|
+
Requires-Dist: trio-websocket==0.11.1
|
103
|
+
Requires-Dist: wsproto==1.2.0
|
104
|
+
Requires-Dist: websocket-client==1.8.0
|
105
|
+
Requires-Dist: selenium==4.27.1
|
106
|
+
Requires-Dist: cssselect==1.2.0
|
107
|
+
Requires-Dist: sortedcontainers==2.4.0
|
108
|
+
Requires-Dist: execnet==2.1.1
|
109
|
+
Requires-Dist: iniconfig==2.0.0
|
110
|
+
Requires-Dist: pluggy==1.5.0
|
111
|
+
Requires-Dist: pytest==8.3.4
|
112
|
+
Requires-Dist: pytest-html==4.0.2
|
113
|
+
Requires-Dist: pytest-metadata==3.1.1
|
114
|
+
Requires-Dist: pytest-ordering==0.6
|
115
|
+
Requires-Dist: pytest-rerunfailures==14.0; python_version < "3.9"
|
116
|
+
Requires-Dist: pytest-rerunfailures==15.0; python_version >= "3.9"
|
117
|
+
Requires-Dist: pytest-xdist==3.6.1
|
118
|
+
Requires-Dist: parameterized==0.9.0
|
119
|
+
Requires-Dist: behave==1.2.6
|
120
|
+
Requires-Dist: soupsieve==2.6
|
121
|
+
Requires-Dist: beautifulsoup4==4.12.3
|
122
|
+
Requires-Dist: pyotp==2.9.0
|
123
|
+
Requires-Dist: python-xlib==0.33; platform_system == "Linux"
|
124
|
+
Requires-Dist: markdown-it-py==3.0.0
|
125
|
+
Requires-Dist: mdurl==0.1.2
|
126
|
+
Requires-Dist: rich==13.9.4
|
128
127
|
Provides-Extra: allure
|
129
|
-
Requires-Dist: allure-pytest
|
130
|
-
Requires-Dist: allure-python-commons
|
131
|
-
Requires-Dist: allure-behave
|
128
|
+
Requires-Dist: allure-pytest>=2.13.5; extra == "allure"
|
129
|
+
Requires-Dist: allure-python-commons>=2.13.5; extra == "allure"
|
130
|
+
Requires-Dist: allure-behave>=2.13.5; extra == "allure"
|
132
131
|
Provides-Extra: coverage
|
133
|
-
Requires-Dist:
|
134
|
-
Requires-Dist: coverage
|
135
|
-
Requires-Dist:
|
132
|
+
Requires-Dist: coverage>=7.6.1; python_version < "3.9" and extra == "coverage"
|
133
|
+
Requires-Dist: coverage>=7.6.10; python_version >= "3.9" and extra == "coverage"
|
134
|
+
Requires-Dist: pytest-cov>=5.0.0; python_version < "3.9" and extra == "coverage"
|
135
|
+
Requires-Dist: pytest-cov>=6.0.0; python_version >= "3.9" and extra == "coverage"
|
136
136
|
Provides-Extra: flake8
|
137
|
-
Requires-Dist:
|
138
|
-
Requires-Dist: flake8
|
139
|
-
Requires-Dist:
|
140
|
-
Requires-Dist:
|
141
|
-
Requires-Dist:
|
142
|
-
Requires-Dist:
|
143
|
-
Requires-Dist: pycodestyle
|
137
|
+
Requires-Dist: flake8==5.0.4; python_version < "3.9" and extra == "flake8"
|
138
|
+
Requires-Dist: flake8==7.1.1; python_version >= "3.9" and extra == "flake8"
|
139
|
+
Requires-Dist: mccabe==0.7.0; extra == "flake8"
|
140
|
+
Requires-Dist: pyflakes==2.5.0; python_version < "3.9" and extra == "flake8"
|
141
|
+
Requires-Dist: pyflakes==3.2.0; python_version >= "3.9" and extra == "flake8"
|
142
|
+
Requires-Dist: pycodestyle==2.9.1; python_version < "3.9" and extra == "flake8"
|
143
|
+
Requires-Dist: pycodestyle==2.12.1; python_version >= "3.9" and extra == "flake8"
|
144
144
|
Provides-Extra: ipdb
|
145
|
-
Requires-Dist: ipdb
|
146
|
-
Requires-Dist: ipython
|
145
|
+
Requires-Dist: ipdb==0.13.13; extra == "ipdb"
|
146
|
+
Requires-Dist: ipython==7.34.0; extra == "ipdb"
|
147
|
+
Provides-Extra: mss
|
148
|
+
Requires-Dist: mss==9.0.2; extra == "mss"
|
147
149
|
Provides-Extra: pdfminer
|
148
|
-
Requires-Dist:
|
149
|
-
Requires-Dist:
|
150
|
-
Requires-Dist:
|
151
|
-
Requires-Dist:
|
152
|
-
Requires-Dist:
|
153
|
-
Requires-Dist: cffi ==1.16.0 ; (python_version >= "3.8") and extra == 'pdfminer'
|
154
|
-
Requires-Dist: cryptography ==42.0.5 ; (python_version >= "3.9") and extra == 'pdfminer'
|
150
|
+
Requires-Dist: pdfminer.six==20240706; extra == "pdfminer"
|
151
|
+
Requires-Dist: cryptography==39.0.2; python_version < "3.9" and extra == "pdfminer"
|
152
|
+
Requires-Dist: cryptography==44.0.0; python_version >= "3.9" and extra == "pdfminer"
|
153
|
+
Requires-Dist: cffi==1.17.1; extra == "pdfminer"
|
154
|
+
Requires-Dist: pycparser==2.22; extra == "pdfminer"
|
155
155
|
Provides-Extra: pillow
|
156
|
-
Requires-Dist: Pillow
|
157
|
-
Requires-Dist: Pillow
|
156
|
+
Requires-Dist: Pillow>=10.4.0; python_version < "3.9" and extra == "pillow"
|
157
|
+
Requires-Dist: Pillow>=11.1.0; python_version >= "3.9" and extra == "pillow"
|
158
|
+
Provides-Extra: pip-system-certs
|
159
|
+
Requires-Dist: pip-system-certs==4.0; platform_system == "Windows" and extra == "pip-system-certs"
|
158
160
|
Provides-Extra: proxy
|
159
|
-
Requires-Dist: proxy.py
|
161
|
+
Requires-Dist: proxy.py==2.4.3; extra == "proxy"
|
160
162
|
Provides-Extra: psutil
|
161
|
-
Requires-Dist: psutil
|
163
|
+
Requires-Dist: psutil==6.0.0; extra == "psutil"
|
164
|
+
Provides-Extra: pyautogui
|
165
|
+
Requires-Dist: PyAutoGUI==0.9.54; extra == "pyautogui"
|
162
166
|
Provides-Extra: selenium-stealth
|
163
|
-
Requires-Dist: selenium-stealth
|
167
|
+
Requires-Dist: selenium-stealth==1.0.6; extra == "selenium-stealth"
|
164
168
|
Provides-Extra: selenium-wire
|
165
|
-
Requires-Dist: selenium-wire
|
166
|
-
Requires-Dist:
|
167
|
-
Requires-Dist:
|
168
|
-
Requires-Dist:
|
169
|
-
Requires-Dist:
|
170
|
-
Requires-Dist:
|
171
|
-
Requires-Dist:
|
172
|
-
Requires-Dist:
|
173
|
-
Requires-Dist:
|
169
|
+
Requires-Dist: selenium-wire==5.1.0; extra == "selenium-wire"
|
170
|
+
Requires-Dist: pyOpenSSL==24.2.1; extra == "selenium-wire"
|
171
|
+
Requires-Dist: pyparsing>=3.1.4; extra == "selenium-wire"
|
172
|
+
Requires-Dist: Brotli==1.1.0; extra == "selenium-wire"
|
173
|
+
Requires-Dist: blinker==1.7.0; extra == "selenium-wire"
|
174
|
+
Requires-Dist: h2==4.1.0; extra == "selenium-wire"
|
175
|
+
Requires-Dist: hpack==4.0.0; extra == "selenium-wire"
|
176
|
+
Requires-Dist: hyperframe==6.0.1; extra == "selenium-wire"
|
177
|
+
Requires-Dist: kaitaistruct==0.10; extra == "selenium-wire"
|
178
|
+
Requires-Dist: pyasn1==0.6.1; extra == "selenium-wire"
|
179
|
+
Requires-Dist: zstandard==0.23.0; extra == "selenium-wire"
|
180
|
+
Dynamic: author
|
181
|
+
Dynamic: author-email
|
182
|
+
Dynamic: classifier
|
183
|
+
Dynamic: home-page
|
184
|
+
Dynamic: keywords
|
185
|
+
Dynamic: license
|
186
|
+
Dynamic: maintainer
|
187
|
+
Dynamic: platform
|
188
|
+
Dynamic: provides-extra
|
189
|
+
Dynamic: requires-dist
|
190
|
+
Dynamic: requires-python
|
191
|
+
Dynamic: summary
|
174
192
|
|
175
193
|
<!-- SeleniumBase Docs -->
|
176
194
|
|
195
|
+
<meta property="og:site_name" content="SeleniumBase">
|
196
|
+
<meta property="og:title" content="SeleniumBase: Python Web Automation and E2E Testing" />
|
197
|
+
<meta property="og:description" content="Fast, easy, and reliable Web/UI testing with Python." />
|
198
|
+
<meta property="og:keywords" content="Python, pytest, selenium, webdriver, testing, automation, seleniumbase, framework, dashboard, recorder, reports, screenshots">
|
199
|
+
<meta property="og:image" content="https://seleniumbase.github.io/cdn/img/mac_sb_logo_5b.png" />
|
200
|
+
<link rel="icon" href="https://seleniumbase.github.io/img/logo7.png" />
|
177
201
|
|
178
202
|
<h1>SeleniumBase</h1>
|
179
203
|
|
180
|
-
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/
|
204
|
+
<p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" alt="SeleniumBase" title="SeleniumBase" width="350" /></a></p>
|
181
205
|
|
182
|
-
<p align="center" class="hero__title"><b>All-in-one Browser Automation Framework:<br />Web Crawling / Scraping / Testing / Reporting</b></p>
|
183
206
|
|
184
|
-
<p align="center"
|
207
|
+
<p align="center" class="hero__title"><b>All-in-one Browser Automation Framework:<br />Web Crawling / Testing / Scraping / Stealth</b></p>
|
208
|
+
|
209
|
+
<p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/badge/join-discord-infomational" alt="Join the SeleniumBase chat on Discord"/></a></p>
|
185
210
|
|
186
211
|
<p align="center">
|
187
212
|
<a href="#python_installation">🚀 Start</a> |
|
188
213
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md">🏰 Features</a> |
|
189
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📚 Examples</a> |
|
190
214
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md">🎛️ Options</a> |
|
215
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/ReadMe.md">📚 Examples</a> |
|
191
216
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/console_scripts/ReadMe.md">🌠 Scripts</a> |
|
192
217
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mobile_testing.md">📱 Mobile</a>
|
193
218
|
<br />
|
194
219
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/method_summary.md">📘 APIs</a> |
|
195
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">
|
196
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📊 Dashboard</a> |
|
220
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md"> 🔠 Formats</a> |
|
197
221
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/recorder_mode.md">🔴 Recorder</a> |
|
222
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/example_logs/ReadMe.md">📊 Dashboard</a> |
|
198
223
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/locale_codes.md">🗾 Locales</a> |
|
199
|
-
<a href="https://
|
224
|
+
<a href="https://seleniumbase.io/devices/?url=seleniumbase.com">💻 Farm</a>
|
200
225
|
<br />
|
201
226
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/commander.md">🎖️ GUI</a> |
|
202
227
|
<a href="https://seleniumbase.io/demo_page">📰 TestPage</a> |
|
203
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md">🗂️ CasePlans</a> |
|
204
228
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md">👤 UC Mode</a> |
|
205
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/
|
206
|
-
<a href="https://
|
229
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md">🐙 CDP Mode</a> |
|
230
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/chart_maker/ReadMe.md">📶 Charts</a> |
|
231
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md">🌐 Grid</a>
|
207
232
|
<br />
|
208
233
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/how_it_works.md">👁️ How</a> |
|
209
234
|
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/migration/raw_selenium">🚝 Migrate</a> |
|
210
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/
|
211
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/
|
212
|
-
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/
|
235
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/case_plans.md">🗂️ CasePlans</a> |
|
236
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/tree/master/examples/boilerplates">♻️ Template</a> |
|
237
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/master_qa/ReadMe.md">🧬 Hybrid</a> |
|
213
238
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">🚎 Tours</a>
|
214
239
|
<br />
|
215
240
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/github/workflows/ReadMe.md">🤖 CI/CD</a> |
|
@@ -221,19 +246,82 @@ Requires-Dist: zstandard ==0.22.0 ; extra == 'selenium-wire'
|
|
221
246
|
<br />
|
222
247
|
</p>
|
223
248
|
|
249
|
+
<p>SeleniumBase is the professional toolkit for web automation activities. Built for testing websites, bypassing CAPTCHAs, enhancing productivity, completing tasks, and scaling your business.</p>
|
250
|
+
|
224
251
|
--------
|
225
252
|
|
226
|
-
📚 Learn from [**over 200 examples** in the **SeleniumBase/examples/**](https://github.com/seleniumbase/SeleniumBase/tree/master/examples)
|
253
|
+
📚 Learn from [**over 200 examples** in the **SeleniumBase/examples/** folder](https://github.com/seleniumbase/SeleniumBase/tree/master/examples).
|
227
254
|
|
228
|
-
<
|
255
|
+
🐙 Note that <a translate="no" href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/uc_mode.md"><b>UC Mode</b></a> / <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/ReadMe.md"><b>CDP Mode</b></a> (Stealth Mode) have their own ReadMe files.
|
229
256
|
|
230
|
-
|
231
|
-
|
257
|
+
ℹ️ Most scripts run with raw <code translate="no"><b>python</b></code>, although some scripts use <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">Syntax Formats</a> that expect <a href="https://docs.pytest.org/en/latest/how-to/usage.html" translate="no"><b>pytest</b></a> (a Python unit-testing framework included with SeleniumBase that can discover, collect, and run tests automatically).
|
258
|
+
|
259
|
+
--------
|
260
|
+
|
261
|
+
<p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py">raw_google.py</a>, which performs a Google search:</p>
|
262
|
+
|
263
|
+
```python
|
264
|
+
from seleniumbase import SB
|
265
|
+
|
266
|
+
with SB(test=True) as sb:
|
267
|
+
sb.open("https://google.com/ncr")
|
268
|
+
sb.type('[title="Search"]', "SeleniumBase GitHub page\n")
|
269
|
+
sb.click('[href*="github.com/seleniumbase/"]')
|
270
|
+
sb.save_screenshot_to_logs() # ./latest_logs/
|
271
|
+
print(sb.get_page_title())
|
232
272
|
```
|
233
273
|
|
234
|
-
|
274
|
+
> `python raw_google.py`
|
275
|
+
|
276
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py"><img src="https://seleniumbase.github.io/cdn/gif/google_search.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="420" /></a>
|
277
|
+
|
278
|
+
--------
|
279
|
+
|
280
|
+
<p align="left">📗 Here's an example of bypassing Cloudflare's challenge page: <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/cdp_mode/raw_gitlab.py">SeleniumBase/examples/cdp_mode/raw_gitlab.py</a></p>
|
235
281
|
|
236
|
-
|
282
|
+
```python
|
283
|
+
from seleniumbase import SB
|
284
|
+
|
285
|
+
with SB(uc=True, test=True, locale_code="en") as sb:
|
286
|
+
url = "https://gitlab.com/users/sign_in"
|
287
|
+
sb.activate_cdp_mode(url)
|
288
|
+
sb.uc_gui_click_captcha()
|
289
|
+
sb.sleep(2)
|
290
|
+
```
|
291
|
+
|
292
|
+
<img src="https://seleniumbase.github.io/other/cf_sec.jpg" title="SeleniumBase" width="332"> <img src="https://seleniumbase.github.io/other/gitlab_bypass.png" title="SeleniumBase" width="288">
|
293
|
+
|
294
|
+
--------
|
295
|
+
|
296
|
+
<p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_get_swag.py">test_get_swag.py</a>, which tests an e-commerce site:</p>
|
297
|
+
|
298
|
+
```python
|
299
|
+
from seleniumbase import BaseCase
|
300
|
+
BaseCase.main(__name__, __file__) # Call pytest
|
301
|
+
|
302
|
+
class MyTestClass(BaseCase):
|
303
|
+
def test_swag_labs(self):
|
304
|
+
self.open("https://www.saucedemo.com")
|
305
|
+
self.type("#user-name", "standard_user")
|
306
|
+
self.type("#password", "secret_sauce\n")
|
307
|
+
self.assert_element("div.inventory_list")
|
308
|
+
self.click('button[name*="backpack"]')
|
309
|
+
self.click("#shopping_cart_container a")
|
310
|
+
self.assert_text("Backpack", "div.cart_item")
|
311
|
+
self.click("button#checkout")
|
312
|
+
self.type("input#first-name", "SeleniumBase")
|
313
|
+
self.type("input#last-name", "Automation")
|
314
|
+
self.type("input#postal-code", "77123")
|
315
|
+
self.click("input#continue")
|
316
|
+
self.click("button#finish")
|
317
|
+
self.assert_text("Thank you for your order!")
|
318
|
+
```
|
319
|
+
|
320
|
+
> `pytest test_get_swag.py`
|
321
|
+
|
322
|
+
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_get_swag.py"><img src="https://seleniumbase.github.io/cdn/gif/fast_swag_2.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>
|
323
|
+
|
324
|
+
> (The default browser is ``--chrome`` if not set.)
|
237
325
|
|
238
326
|
--------
|
239
327
|
|
@@ -265,7 +353,7 @@ pytest test_demo_site.py
|
|
265
353
|
|
266
354
|
--------
|
267
355
|
|
268
|
-
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/
|
356
|
+
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" alt="SeleniumBase" title="SeleniumBase" width="232" /></a></p>
|
269
357
|
|
270
358
|
<blockquote>
|
271
359
|
<p dir="auto"><strong>Explore the README:</strong></p>
|
@@ -327,7 +415,7 @@ With raw Selenium, that requires more code:<br />
|
|
327
415
|
|
328
416
|
<p>📚 <b>Learn about different ways of writing tests:</b></p>
|
329
417
|
|
330
|
-
<p align="left"
|
418
|
+
<p align="left">📗📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_simple_login.py">test_simple_login.py</a>, which uses <code translate="no"><a href="https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py">BaseCase</a></code> class inheritance, and runs with <a href="https://docs.pytest.org/en/latest/how-to/usage.html">pytest</a> or <a href="https://github.com/mdmintz/pynose">pynose</a>. (Use <code translate="no">self.driver</code> to access Selenium's raw <code translate="no">driver</code>.)</p>
|
331
419
|
|
332
420
|
```python
|
333
421
|
from seleniumbase import BaseCase
|
@@ -346,22 +434,7 @@ class TestSimpleLogin(BaseCase):
|
|
346
434
|
self.assert_text("signed out", "#top_message")
|
347
435
|
```
|
348
436
|
|
349
|
-
<p align="left"
|
350
|
-
|
351
|
-
```python
|
352
|
-
def test_sb_fixture_with_no_class(sb):
|
353
|
-
sb.open("seleniumbase.io/simple/login")
|
354
|
-
sb.type("#username", "demo_user")
|
355
|
-
sb.type("#password", "secret_pass")
|
356
|
-
sb.click('a:contains("Sign in")')
|
357
|
-
sb.assert_exact_text("Welcome!", "h1")
|
358
|
-
sb.assert_element("img#image1")
|
359
|
-
sb.highlight("#image1")
|
360
|
-
sb.click_link("Sign out")
|
361
|
-
sb.assert_text("signed out", "#top_message")
|
362
|
-
```
|
363
|
-
|
364
|
-
<p align="left">📙📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_sb.py">raw_login_sb.py</a>, which uses the <b><code translate="no">SB</code></b> Context Manager. Runs with pure <code translate="no">python</code>. (Use <code translate="no">sb.driver</code> to access Selenium's raw <code translate="no">driver</code>.)</p>
|
437
|
+
<p align="left">📘📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_sb.py">raw_login_sb.py</a>, which uses the <b><code translate="no">SB</code></b> Context Manager. Runs with pure <code translate="no">python</code>. (Use <code translate="no">sb.driver</code> to access Selenium's raw <code translate="no">driver</code>.)</p>
|
365
438
|
|
366
439
|
```python
|
367
440
|
from seleniumbase import SB
|
@@ -378,24 +451,7 @@ with SB() as sb:
|
|
378
451
|
sb.assert_text("signed out", "#top_message")
|
379
452
|
```
|
380
453
|
|
381
|
-
<p align="left"
|
382
|
-
|
383
|
-
```python
|
384
|
-
from seleniumbase import DriverContext
|
385
|
-
|
386
|
-
with DriverContext() as driver:
|
387
|
-
driver.open("seleniumbase.io/simple/login")
|
388
|
-
driver.type("#username", "demo_user")
|
389
|
-
driver.type("#password", "secret_pass")
|
390
|
-
driver.click('a:contains("Sign in")')
|
391
|
-
driver.assert_exact_text("Welcome!", "h1")
|
392
|
-
driver.assert_element("img#image1")
|
393
|
-
driver.highlight("#image1")
|
394
|
-
driver.click_link("Sign out")
|
395
|
-
driver.assert_text("signed out", "#top_message")
|
396
|
-
```
|
397
|
-
|
398
|
-
<p align="left">📔📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_driver.py">raw_login_driver.py</a>, which uses the <b><code translate="no">Driver</code></b> Manager. Runs with pure <code translate="no">python</code>. (The <code>driver</code> is an improved version of Selenium's raw <code translate="no">driver</code>, with more methods.)</p>
|
454
|
+
<p align="left">📙📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_login_driver.py">raw_login_driver.py</a>, which uses the <b><code translate="no">Driver</code></b> Manager. Runs with pure <code translate="no">python</code>. (The <code>driver</code> is an improved version of Selenium's raw <code translate="no">driver</code>, with more methods.)</p>
|
399
455
|
|
400
456
|
```python
|
401
457
|
from seleniumbase import Driver
|
@@ -415,23 +471,6 @@ finally:
|
|
415
471
|
driver.quit()
|
416
472
|
```
|
417
473
|
|
418
|
-
<p align="left">📕📝 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/features/login_app.feature">login_app.feature</a>, which uses <a translate="no" href="https://behave.readthedocs.io/en/stable/gherkin.html#features" target="_blank">behave-BDD Gherkin</a> syntax. Runs with <code translate="no">behave</code>. (<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">Learn about the <b>SeleniumBase behave-BDD</b> integration</a>)</p>
|
419
|
-
|
420
|
-
```gherkin
|
421
|
-
Feature: SeleniumBase scenarios for the Simple App
|
422
|
-
|
423
|
-
Scenario: Verify the Simple App (Login / Logout)
|
424
|
-
Given Open "seleniumbase.io/simple/login"
|
425
|
-
And Type "demo_user" into "#username"
|
426
|
-
And Type "secret_pass" into "#password"
|
427
|
-
And Click 'a:contains("Sign in")'
|
428
|
-
And Assert exact text "Welcome!" in "h1"
|
429
|
-
And Assert element "img#image1"
|
430
|
-
And Highlight "#image1"
|
431
|
-
And Click link "Sign out"
|
432
|
-
And Assert text "signed out" in "#top_message"
|
433
|
-
```
|
434
|
-
|
435
474
|
--------
|
436
475
|
|
437
476
|
<a id="python_installation"></a>
|
@@ -476,48 +515,49 @@ pip install -e .
|
|
476
515
|
🔵 **Type ``seleniumbase`` or ``sbase`` to verify that SeleniumBase was installed successfully:**
|
477
516
|
|
478
517
|
```bash
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
COMMANDS:
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
518
|
+
___ _ _ ___
|
519
|
+
/ __| ___| |___ _ _ (_)_ _ _ __ | _ ) __ _ ______
|
520
|
+
\__ \/ -_) / -_) ' \| | \| | ' \ | _ \/ _` (_-< -_)
|
521
|
+
|___/\___|_\___|_||_|_|\_,_|_|_|_\|___/\__,_/__|___|
|
522
|
+
----------------------------------------------------
|
523
|
+
|
524
|
+
╭──────────────────────────────────────────────────╮
|
525
|
+
│ * USAGE: "seleniumbase [COMMAND] [PARAMETERS]" │
|
526
|
+
│ * OR: "sbase [COMMAND] [PARAMETERS]" │
|
527
|
+
│ │
|
528
|
+
│ COMMANDS: PARAMETERS / DESCRIPTIONS: │
|
529
|
+
│ get / install [DRIVER_NAME] [OPTIONS] │
|
530
|
+
│ methods (List common Python methods) │
|
531
|
+
│ options (List common pytest options) │
|
532
|
+
│ behave-options (List common behave options) │
|
533
|
+
│ gui / commander [OPTIONAL PATH or TEST FILE] │
|
534
|
+
│ behave-gui (SBase Commander for Behave) │
|
535
|
+
│ caseplans [OPTIONAL PATH or TEST FILE] │
|
536
|
+
│ mkdir [DIRECTORY] [OPTIONS] │
|
537
|
+
│ mkfile [FILE.py] [OPTIONS] │
|
538
|
+
│ mkrec / codegen [FILE.py] [OPTIONS] │
|
539
|
+
│ recorder (Open Recorder Desktop App.) │
|
540
|
+
│ record (If args: mkrec. Else: App.) │
|
541
|
+
│ mkpres [FILE.py] [LANG] │
|
542
|
+
│ mkchart [FILE.py] [LANG] │
|
543
|
+
│ print [FILE] [OPTIONS] │
|
544
|
+
│ translate [SB_FILE.py] [LANG] [ACTION] │
|
545
|
+
│ convert [WEBDRIVER_UNITTEST_FILE.py] │
|
546
|
+
│ extract-objects [SB_FILE.py] │
|
547
|
+
│ inject-objects [SB_FILE.py] [OPTIONS] │
|
548
|
+
│ objectify [SB_FILE.py] [OPTIONS] │
|
549
|
+
│ revert-objects [SB_FILE.py] [OPTIONS] │
|
550
|
+
│ encrypt / obfuscate │
|
551
|
+
│ decrypt / unobfuscate │
|
552
|
+
│ proxy (Start a basic proxy server) │
|
553
|
+
│ download server (Get Selenium Grid JAR file) │
|
554
|
+
│ grid-hub [start|stop] [OPTIONS] │
|
555
|
+
│ grid-node [start|stop] --hub=[HOST/IP] │
|
556
|
+
│ │
|
557
|
+
│ * EXAMPLE => "sbase get chromedriver stable" │
|
558
|
+
│ * For command info => "sbase help [COMMAND]" │
|
559
|
+
│ * For info on all commands => "sbase --help" │
|
560
|
+
╰──────────────────────────────────────────────────╯
|
521
561
|
```
|
522
562
|
|
523
563
|
<h3>🔵 Downloading webdrivers:</h3>
|
@@ -529,20 +569,21 @@ COMMANDS:
|
|
529
569
|
<summary> ▶️ Here's sample output from a chromedriver download. (<b>click to expand</b>)</summary>
|
530
570
|
|
531
571
|
```bash
|
532
|
-
*** chromedriver to download =
|
572
|
+
*** chromedriver to download = 131.0.6778.108 (Latest Stable)
|
533
573
|
|
534
574
|
Downloading chromedriver-mac-arm64.zip from:
|
535
|
-
https://storage.googleapis.com/chrome-for-testing-public/
|
575
|
+
https://storage.googleapis.com/chrome-for-testing-public/131.0.6778.108/mac-arm64/chromedriver-mac-arm64.zip ...
|
536
576
|
Download Complete!
|
537
577
|
|
538
578
|
Extracting ['chromedriver'] from chromedriver-mac-arm64.zip ...
|
539
579
|
Unzip Complete!
|
540
580
|
|
541
581
|
The file [chromedriver] was saved to:
|
542
|
-
|
582
|
+
~/github/SeleniumBase/seleniumbase/drivers/
|
583
|
+
chromedriver
|
543
584
|
|
544
|
-
Making [chromedriver
|
545
|
-
[chromedriver
|
585
|
+
Making [chromedriver 131.0.6778.108] executable ...
|
586
|
+
[chromedriver 131.0.6778.108] is now ready for use!
|
546
587
|
```
|
547
588
|
|
548
589
|
</details>
|
@@ -562,7 +603,7 @@ pytest my_first_test.py
|
|
562
603
|
|
563
604
|
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py"><img src="https://seleniumbase.github.io/cdn/gif/fast_swag_2.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>
|
564
605
|
|
565
|
-
<p align="left"><b>Here's the code for <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>:</b></p>
|
606
|
+
<p align="left"><b>Here's the full code for <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>:</b></p>
|
566
607
|
|
567
608
|
```python
|
568
609
|
from seleniumbase import BaseCase
|
@@ -812,11 +853,14 @@ pytest test_coffee_cart.py --trace
|
|
812
853
|
--binary-location=PATH # (Set path of the Chromium browser binary to use.)
|
813
854
|
--driver-version=VER # (Set the chromedriver or uc_driver version to use.)
|
814
855
|
--sjw # (Skip JS Waits for readyState to be "complete" or Angular to load.)
|
856
|
+
--wfa # (Wait for AngularJS to be done loading after specific web actions.)
|
815
857
|
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
|
816
|
-
--headless # (
|
817
|
-
--
|
858
|
+
--headless # (The default headless mode. Linux uses this mode by default.)
|
859
|
+
--headless1 # (Use Chrome's old headless mode. Fast, but has limitations.)
|
860
|
+
--headless2 # (Use Chrome's new headless mode, which supports extensions.)
|
818
861
|
--headed # (Run tests in headed/GUI mode on Linux OS, where not default.)
|
819
862
|
--xvfb # (Run tests using the Xvfb virtual display server on Linux OS.)
|
863
|
+
--xvfb-metrics=STRING # (Set Xvfb display size on Linux: "Width,Height".)
|
820
864
|
--locale=LOCALE_CODE # (Set the Language Locale Code for the web browser.)
|
821
865
|
--interval=SECONDS # (The autoplay interval for presentations & tour steps)
|
822
866
|
--start-page=URL # (The starting URL for the web browser when tests begin.)
|
@@ -834,10 +878,12 @@ pytest test_coffee_cart.py --trace
|
|
834
878
|
--block-images # (Block images from loading during tests.)
|
835
879
|
--do-not-track # (Indicate to websites that you don't want to be tracked.)
|
836
880
|
--verify-delay=SECONDS # (The delay before MasterQA verification checks.)
|
881
|
+
--ee | --esc-end # (Lets the user end the current test via the ESC key.)
|
837
882
|
--recorder # (Enables the Recorder for turning browser actions into code.)
|
838
883
|
--rec-behave # (Same as Recorder Mode, but also generates behave-gherkin.)
|
839
884
|
--rec-sleep # (If the Recorder is enabled, also records self.sleep calls.)
|
840
885
|
--rec-print # (If the Recorder is enabled, prints output after tests end.)
|
886
|
+
--disable-cookies # (Disable Cookies on websites. Pages might break!)
|
841
887
|
--disable-js # (Disable JavaScript on websites. Pages might break!)
|
842
888
|
--disable-csp # (Disable the Content Security Policy of websites.)
|
843
889
|
--disable-ws # (Disable Web Security on Chromium-based browsers.)
|
@@ -860,6 +906,7 @@ pytest test_coffee_cart.py --trace
|
|
860
906
|
--rcs | --reuse-class-session # (Reuse session for tests in class.)
|
861
907
|
--crumbs # (Delete all cookies between tests reusing a session.)
|
862
908
|
--disable-beforeunload # (Disable the "beforeunload" event on Chrome.)
|
909
|
+
--window-position=X,Y # (Set the browser's starting window position.)
|
863
910
|
--window-size=WIDTH,HEIGHT # (Set the browser's starting window size.)
|
864
911
|
--maximize # (Start tests with the browser window maximized.)
|
865
912
|
--screenshot # (Save a screenshot at the end of each test.)
|
@@ -972,7 +1019,7 @@ You can run it from the ``examples/`` folder like this:
|
|
972
1019
|
pytest test_fail.py
|
973
1020
|
```
|
974
1021
|
|
975
|
-
🔵 You'll notice that a logs folder,
|
1022
|
+
🔵 You'll notice that a logs folder, ``./latest_logs/``, was created to hold information (and screenshots) about the failing test. During test runs, past results get moved to the archived_logs folder if you have ARCHIVE_EXISTING_LOGS set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py), or if your run tests with ``--archive-logs``. If you choose not to archive existing logs, they will be deleted and replaced by the logs of the latest test run.
|
976
1023
|
|
977
1024
|
--------
|
978
1025
|
|
@@ -1001,14 +1048,14 @@ python -m http.server 1948
|
|
1001
1048
|
pytest test_suite.py test_image_saving.py --dashboard --rs --headless
|
1002
1049
|
```
|
1003
1050
|
|
1004
|
-
<img src="https://seleniumbase.github.io/cdn/img/dashboard_2.png" alt="The SeleniumBase Dashboard" title="The SeleniumBase Dashboard" width="
|
1051
|
+
<img src="https://seleniumbase.github.io/cdn/img/dashboard_2.png" alt="The SeleniumBase Dashboard" title="The SeleniumBase Dashboard" width="520" />
|
1005
1052
|
|
1006
1053
|
--------
|
1007
1054
|
|
1008
1055
|
<a id="creating_visual_reports"></a>
|
1009
1056
|
<h2><img src="https://seleniumbase.github.io/img/logo7.png" title="SeleniumBase" width="32" /> Generating Test Reports:</h2>
|
1010
1057
|
|
1011
|
-
<h3>🔵
|
1058
|
+
<h3>🔵 <code>pytest</code> HTML Reports:</h3>
|
1012
1059
|
|
1013
1060
|
✅ Using ``--html=report.html`` gives you a fancy report of the name specified after your test suite completes.
|
1014
1061
|
|
@@ -1028,7 +1075,7 @@ pytest test_suite.py --dashboard --html=report.html
|
|
1028
1075
|
|
1029
1076
|
<img src="https://seleniumbase.github.io/cdn/img/dash_report.jpg" alt="Dashboard Pytest HTML Report" title="Dashboard Pytest HTML Report" width="520" />
|
1030
1077
|
|
1031
|
-
If viewing pytest html reports in [Jenkins](https://www.jenkins.io/), you may need to [configure Jenkins settings](https://stackoverflow.com/a/46197356) for the html to render correctly. This is due to [Jenkins CSP changes](https://www.jenkins.io/doc/book/system-administration/security/configuring-content-security-policy/).
|
1078
|
+
If viewing pytest html reports in [Jenkins](https://www.jenkins.io/), you may need to [configure Jenkins settings](https://stackoverflow.com/a/46197356/7058266) for the html to render correctly. This is due to [Jenkins CSP changes](https://www.jenkins.io/doc/book/system-administration/security/configuring-content-security-policy/).
|
1032
1079
|
|
1033
1080
|
You can also use ``--junit-xml=report.xml`` to get an xml report instead. Jenkins can use this file to display better reporting for your tests.
|
1034
1081
|
|
@@ -1036,7 +1083,7 @@ You can also use ``--junit-xml=report.xml`` to get an xml report instead. Jenkin
|
|
1036
1083
|
pytest test_suite.py --junit-xml=report.xml
|
1037
1084
|
```
|
1038
1085
|
|
1039
|
-
<h3>🔵 pynose Reports:</h3>
|
1086
|
+
<h3>🔵 <code>pynose</code> Reports:</h3>
|
1040
1087
|
|
1041
1088
|
The ``--report`` option gives you a fancy report after your test suite completes.
|
1042
1089
|
|
@@ -1048,7 +1095,7 @@ pynose test_suite.py --report
|
|
1048
1095
|
|
1049
1096
|
(NOTE: You can add ``--show-report`` to immediately display pynose reports after the test suite completes. Only use ``--show-report`` when running tests locally because it pauses the test run.)
|
1050
1097
|
|
1051
|
-
<h3>🔵
|
1098
|
+
<h3>🔵 <code>behave</code> Dashboard & Reports:</h3>
|
1052
1099
|
|
1053
1100
|
(The [behave_bdd/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/behave_bdd) folder can be found in the [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder.)
|
1054
1101
|
|
@@ -1056,7 +1103,7 @@ pynose test_suite.py --report
|
|
1056
1103
|
behave behave_bdd/features/ -D dashboard -D headless
|
1057
1104
|
```
|
1058
1105
|
|
1059
|
-
<img src="https://seleniumbase.github.io/cdn/img/sb_behave_dashboard.png" title="SeleniumBase" width="
|
1106
|
+
<img src="https://seleniumbase.github.io/cdn/img/sb_behave_dashboard.png" title="SeleniumBase" width="520">
|
1060
1107
|
|
1061
1108
|
You can also use ``--junit`` to get ``.xml`` reports for each <code translate="no">behave</code> feature. Jenkins can use these files to display better reporting for your tests.
|
1062
1109
|
|
@@ -1120,7 +1167,7 @@ pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1
|
|
1120
1167
|
```
|
1121
1168
|
|
1122
1169
|
|
1123
|
-
<h3><img src="https://seleniumbase.github.io/img/logo7.png" title="SeleniumBase" width="32" /> Handling Pop-Up
|
1170
|
+
<h3><img src="https://seleniumbase.github.io/img/logo7.png" title="SeleniumBase" width="32" /> Handling Pop-Up Alerts:</h3>
|
1124
1171
|
|
1125
1172
|
🔵 <code translate="no">self.accept_alert()</code> automatically waits for and accepts alert pop-ups. <code translate="no">self.dismiss_alert()</code> automatically waits for and dismisses alert pop-ups. On occasion, some methods like <code translate="no">self.click(SELECTOR)</code> might dismiss a pop-up on its own because they call JavaScript to make sure that the <code translate="no">readyState</code> of the page is <code translate="no">complete</code> before advancing. If you're trying to accept a pop-up that got dismissed this way, use this workaround: Call <code translate="no">self.find_element(SELECTOR).click()</code> instead, (which will let the pop-up remain on the screen), and then use <code translate="no">self.accept_alert()</code> to accept the pop-up (<a href="https://github.com/seleniumbase/SeleniumBase/issues/600#issuecomment-647270426">more on that here</a>). If pop-ups are intermittent, wrap code in a try/except block.
|
1126
1173
|
|
@@ -1518,25 +1565,25 @@ pytest --reruns=1 --reruns-delay=1
|
|
1518
1565
|
|
1519
1566
|
<p>
|
1520
1567
|
<div><b>If you see something, say something!</b></div>
|
1521
|
-
<div><a href="https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed"><img src="https://img.shields.io/github/issues-closed-raw/seleniumbase/SeleniumBase.svg?color=22BB88" title="Closed Issues" /></a>
|
1568
|
+
<div><a href="https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed"><img src="https://img.shields.io/github/issues-closed-raw/seleniumbase/SeleniumBase.svg?color=22BB88" title="Closed Issues" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/pulls?q=is%3Apr+is%3Aclosed"><img src="https://img.shields.io/github/issues-pr-closed/seleniumbase/SeleniumBase.svg?logo=github&logoColor=white&color=22BB99" title="Closed Pull Requests" /></a></div>
|
1522
1569
|
</p>
|
1523
1570
|
|
1524
|
-
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_10t.png" alt="SeleniumBase" title="SeleniumBase" width="
|
1571
|
+
<p align="left"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/sb_logo_10t.png" alt="SeleniumBase" title="SeleniumBase" width="274" /></a></p>
|
1572
|
+
|
1573
|
+
<a href="https://pypi.org/project/seleniumbase/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE&logo=python&logoColor=FEDC54" title="Supported Python Versions" /></a>
|
1525
1574
|
|
1526
1575
|
<p><div>
|
1527
|
-
<span><a href="https://www.youtube.com/playlist?list=PLp9uKicxkBc5UIlGi2BuE3aWC7JyXpD3m"><img src="https://seleniumbase.github.io/cdn/img/youtube.png" title="SeleniumBase Playlist on YouTube" alt="SeleniumBase Playlist on YouTube" width="
|
1528
|
-
<span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="
|
1529
|
-
<span><a href="https://
|
1530
|
-
<span><a href="https://
|
1576
|
+
<span><a href="https://www.youtube.com/playlist?list=PLp9uKicxkBc5UIlGi2BuE3aWC7JyXpD3m"><img src="https://seleniumbase.github.io/cdn/img/youtube.png" title="SeleniumBase Playlist on YouTube" alt="SeleniumBase Playlist on YouTube" width="70" /></a></span>
|
1577
|
+
<span><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://seleniumbase.github.io/img/social/share_github.svg" title="SeleniumBase on GitHub" alt="SeleniumBase on GitHub" width="64" /></a></span>
|
1578
|
+
<span><a href="https://discord.gg/EdhQTn3EyE"><img src="https://seleniumbase.github.io/other/discord_icon.png" title="SeleniumBase on Discord" alt="SeleniumBase on Discord" width="66" /></a></span>
|
1579
|
+
<span><a href="https://www.facebook.com/SeleniumBase"><img src="https://seleniumbase.io/img/social/share_facebook.svg" title="SeleniumBase on Facebook" alt="SeleniumBase on Facebook" width="62" /></a></span>
|
1531
1580
|
</div></p>
|
1532
1581
|
|
1533
1582
|
<p><div><b><a href="https://github.com/mdmintz">https://github.com/mdmintz</a></b></div></p>
|
1534
1583
|
|
1535
|
-
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/
|
1536
|
-
<div><a href="https://
|
1537
|
-
<div><a href="https://github.com/seleniumbase/SeleniumBase/stargazers"><img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg?color=19A57B" title="Stargazers" /></a></div>
|
1538
|
-
|
1539
|
-
|
1540
|
-
|
1541
|
-
<p><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb.png" alt="SeleniumBase" title="SeleniumBase" width="300" /></a></p>
|
1542
|
-
<p><a href="https://pypi.org/project/seleniumbase/" target="_blank"><img src="https://img.shields.io/pypi/pyversions/seleniumbase.svg?color=22AAEE&logo=python&logoColor=FEDC54" title="Supported Python Versions" /></a></p>
|
1584
|
+
<div><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" title="SeleniumBase" width="274" /></a></div>
|
1585
|
+
<div><a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" title="SeleniumBase" /></a></div>
|
1586
|
+
<div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg" alt="Tested with SeleniumBase" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/stargazers"><img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg?color=19A57B" title="Stargazers" /></a></div>
|
1587
|
+
<div><a href="https://hellogithub.com/repository/c6be2d0f1969448697683d11a4ff915e" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=c6be2d0f1969448697683d11a4ff915e&claim_uid=xcrm4p9j3d6JCO5&theme=small" alt="Featured|HelloGitHub" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/badge/join-discord-infomational" alt="Join the SeleniumBase chat on Discord"/></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://img.shields.io/gitter/room/seleniumbase/SeleniumBase.svg" alt="Gitter chat"/></a></div>
|
1588
|
+
<div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://static.pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a> <img src="https://views.whatilearened.today/views/github/seleniumbase/SeleniumBase.svg" width="98px" height="20px" alt="Views" /></div>
|
1589
|
+
<div align="left"></div>
|