seleniumbase 4.35.2__py3-none-any.whl → 4.35.3__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.
- seleniumbase/__version__.py +1 -1
- seleniumbase/core/browser_launcher.py +8 -0
- seleniumbase/core/sb_cdp.py +46 -9
- seleniumbase/fixtures/base_case.py +3 -0
- seleniumbase/undetected/cdp_driver/browser.py +6 -7
- seleniumbase/undetected/cdp_driver/connection.py +1 -1
- seleniumbase/undetected/cdp_driver/tab.py +1 -0
- {seleniumbase-4.35.2.dist-info → seleniumbase-4.35.3.dist-info}/METADATA +3 -3
- {seleniumbase-4.35.2.dist-info → seleniumbase-4.35.3.dist-info}/RECORD +13 -13
- {seleniumbase-4.35.2.dist-info → seleniumbase-4.35.3.dist-info}/LICENSE +0 -0
- {seleniumbase-4.35.2.dist-info → seleniumbase-4.35.3.dist-info}/WHEEL +0 -0
- {seleniumbase-4.35.2.dist-info → seleniumbase-4.35.3.dist-info}/entry_points.txt +0 -0
- {seleniumbase-4.35.2.dist-info → seleniumbase-4.35.3.dist-info}/top_level.txt +0 -0
seleniumbase/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# seleniumbase package
|
2
|
-
__version__ = "4.35.
|
2
|
+
__version__ = "4.35.3"
|
@@ -682,6 +682,13 @@ def uc_open_with_cdp_mode(driver, url=None):
|
|
682
682
|
cdp.gui_hover_element = CDPM.gui_hover_element
|
683
683
|
cdp.gui_hover_and_click = CDPM.gui_hover_and_click
|
684
684
|
cdp.internalize_links = CDPM.internalize_links
|
685
|
+
cdp.switch_to_window = CDPM.switch_to_window
|
686
|
+
cdp.switch_to_newest_window = CDPM.switch_to_newest_window
|
687
|
+
cdp.switch_to_tab = CDPM.switch_to_tab
|
688
|
+
cdp.switch_to_newest_tab = CDPM.switch_to_newest_tab
|
689
|
+
cdp.close_active_tab = CDPM.close_active_tab
|
690
|
+
cdp.get_active_tab = CDPM.get_active_tab
|
691
|
+
cdp.get_tabs = CDPM.get_tabs
|
685
692
|
cdp.get_window = CDPM.get_window
|
686
693
|
cdp.get_element_attributes = CDPM.get_element_attributes
|
687
694
|
cdp.get_element_attribute = CDPM.get_element_attribute
|
@@ -2033,6 +2040,7 @@ def _set_chrome_options(
|
|
2033
2040
|
prefs["download.default_directory"] = downloads_path
|
2034
2041
|
prefs["download.directory_upgrade"] = True
|
2035
2042
|
prefs["download.prompt_for_download"] = False
|
2043
|
+
prefs["download_bubble.partial_view_enabled"] = False
|
2036
2044
|
prefs["credentials_enable_service"] = False
|
2037
2045
|
prefs["local_discovery.notifications_enabled"] = False
|
2038
2046
|
prefs["safebrowsing.enabled"] = False # Prevent PW "data breach" pop-ups
|
seleniumbase/core/sb_cdp.py
CHANGED
@@ -1014,10 +1014,51 @@ class CDPMethods():
|
|
1014
1014
|
self.set_window_rect(x, y, width, height)
|
1015
1015
|
self.__add_light_pause()
|
1016
1016
|
|
1017
|
+
def switch_to_window(self, window):
|
1018
|
+
self.switch_to_tab(window)
|
1019
|
+
|
1020
|
+
def switch_to_newest_window(self):
|
1021
|
+
self.switch_to_tab(-1)
|
1022
|
+
|
1023
|
+
def switch_to_tab(self, tab):
|
1024
|
+
driver = self.driver
|
1025
|
+
if hasattr(driver, "cdp_base"):
|
1026
|
+
driver = driver.cdp_base
|
1027
|
+
if isinstance(tab, int):
|
1028
|
+
self.page = driver.tabs[tab]
|
1029
|
+
elif isinstance(tab, cdp_util.Tab):
|
1030
|
+
self.page = tab
|
1031
|
+
else:
|
1032
|
+
raise Exception("`tab` must be an int or a Tab type!")
|
1033
|
+
self.bring_active_window_to_front()
|
1034
|
+
|
1035
|
+
def switch_to_newest_tab(self):
|
1036
|
+
self.switch_to_tab(-1)
|
1037
|
+
|
1038
|
+
def close_active_tab(self):
|
1039
|
+
"""Close the active tab.
|
1040
|
+
The active tab is the one currenly controlled by CDP.
|
1041
|
+
The active tab MIGHT NOT be the currently visible tab!
|
1042
|
+
(If a page opens a new tab, the new tab WON'T be active)
|
1043
|
+
To switch the active tab, call: sb.switch_to_tab(tab)"""
|
1044
|
+
return self.loop.run_until_complete(self.page.close())
|
1045
|
+
|
1046
|
+
def get_active_tab(self):
|
1047
|
+
"""Return the active tab.
|
1048
|
+
The active tab is the one currenly controlled by CDP.
|
1049
|
+
The active tab MIGHT NOT be the currently visible tab!
|
1050
|
+
(If a page opens a new tab, the new tab WON'T be active)
|
1051
|
+
To switch the active tab, call: sb.switch_to_tab(tab)"""
|
1052
|
+
return self.page
|
1053
|
+
|
1054
|
+
def get_tabs(self):
|
1055
|
+
driver = self.driver
|
1056
|
+
if hasattr(driver, "cdp_base"):
|
1057
|
+
driver = driver.cdp_base
|
1058
|
+
return driver.tabs
|
1059
|
+
|
1017
1060
|
def get_window(self):
|
1018
|
-
return self.loop.run_until_complete(
|
1019
|
-
self.page.get_window()
|
1020
|
-
)
|
1061
|
+
return self.loop.run_until_complete(self.page.get_window())
|
1021
1062
|
|
1022
1063
|
def get_text(self, selector):
|
1023
1064
|
return self.find_element(selector).text_all
|
@@ -1211,14 +1252,10 @@ class CDPMethods():
|
|
1211
1252
|
return ((e_x + e_width / 2.0) + 0.5, (e_y + e_height / 2.0) + 0.5)
|
1212
1253
|
|
1213
1254
|
def get_document(self):
|
1214
|
-
return self.loop.run_until_complete(
|
1215
|
-
self.page.get_document()
|
1216
|
-
)
|
1255
|
+
return self.loop.run_until_complete(self.page.get_document())
|
1217
1256
|
|
1218
1257
|
def get_flattened_document(self):
|
1219
|
-
return self.loop.run_until_complete(
|
1220
|
-
self.page.get_flattened_document()
|
1221
|
-
)
|
1258
|
+
return self.loop.run_until_complete(self.page.get_flattened_document())
|
1222
1259
|
|
1223
1260
|
def get_element_attributes(self, selector):
|
1224
1261
|
selector = self.__convert_to_css_if_xpath(selector)
|
@@ -3918,6 +3918,9 @@ class BaseCase(unittest.TestCase):
|
|
3918
3918
|
timeout = settings.SMALL_TIMEOUT
|
3919
3919
|
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
|
3920
3920
|
timeout = self.__get_new_timeout(timeout)
|
3921
|
+
if self.__is_cdp_swap_needed() and not isinstance(window, str):
|
3922
|
+
self.cdp.switch_to_tab(window)
|
3923
|
+
return
|
3921
3924
|
page_actions.switch_to_window(self.driver, window, timeout)
|
3922
3925
|
|
3923
3926
|
def switch_to_default_window(self):
|
@@ -660,7 +660,7 @@ class CookieJar:
|
|
660
660
|
break
|
661
661
|
else:
|
662
662
|
connection = self._browser.connection
|
663
|
-
cookies = await connection.send(cdp.
|
663
|
+
cookies = await connection.send(cdp.network.get_cookies())
|
664
664
|
if requests_cookie_format:
|
665
665
|
import requests.cookies
|
666
666
|
|
@@ -690,8 +690,7 @@ class CookieJar:
|
|
690
690
|
break
|
691
691
|
else:
|
692
692
|
connection = self._browser.connection
|
693
|
-
|
694
|
-
await connection.send(cdp.storage.set_cookies(cookies))
|
693
|
+
await connection.send(cdp.network.set_cookies(cookies))
|
695
694
|
|
696
695
|
async def save(self, file: PathLike = ".session.dat", pattern: str = ".*"):
|
697
696
|
"""
|
@@ -718,7 +717,7 @@ class CookieJar:
|
|
718
717
|
break
|
719
718
|
else:
|
720
719
|
connection = self._browser.connection
|
721
|
-
cookies = await connection.send(cdp.
|
720
|
+
cookies = await connection.send(cdp.network.get_cookies())
|
722
721
|
# if not connection:
|
723
722
|
# return
|
724
723
|
# if not connection.websocket:
|
@@ -776,7 +775,7 @@ class CookieJar:
|
|
776
775
|
cookie.value,
|
777
776
|
)
|
778
777
|
break
|
779
|
-
await connection.send(cdp.
|
778
|
+
await connection.send(cdp.network.set_cookies(included_cookies))
|
780
779
|
|
781
780
|
async def clear(self):
|
782
781
|
"""
|
@@ -791,9 +790,9 @@ class CookieJar:
|
|
791
790
|
break
|
792
791
|
else:
|
793
792
|
connection = self._browser.connection
|
794
|
-
cookies = await connection.send(cdp.
|
793
|
+
cookies = await connection.send(cdp.network.get_cookies())
|
795
794
|
if cookies:
|
796
|
-
await connection.send(cdp.
|
795
|
+
await connection.send(cdp.network.clear_cookies())
|
797
796
|
|
798
797
|
|
799
798
|
class HTTPApi:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: seleniumbase
|
3
|
-
Version: 4.35.
|
3
|
+
Version: 4.35.3
|
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
|
@@ -110,7 +110,7 @@ Requires-Dist: sortedcontainers==2.4.0
|
|
110
110
|
Requires-Dist: execnet==2.1.1
|
111
111
|
Requires-Dist: iniconfig==2.0.0
|
112
112
|
Requires-Dist: pluggy==1.5.0
|
113
|
-
Requires-Dist: pytest==8.3.
|
113
|
+
Requires-Dist: pytest==8.3.5
|
114
114
|
Requires-Dist: pytest-html==4.0.2
|
115
115
|
Requires-Dist: pytest-metadata==3.1.1
|
116
116
|
Requires-Dist: pytest-ordering==0.6
|
@@ -151,7 +151,7 @@ Requires-Dist: mss==9.0.2; extra == "mss"
|
|
151
151
|
Provides-Extra: pdfminer
|
152
152
|
Requires-Dist: pdfminer.six==20240706; extra == "pdfminer"
|
153
153
|
Requires-Dist: cryptography==39.0.2; python_version < "3.9" and extra == "pdfminer"
|
154
|
-
Requires-Dist: cryptography==44.0.
|
154
|
+
Requires-Dist: cryptography==44.0.2; python_version >= "3.9" and extra == "pdfminer"
|
155
155
|
Requires-Dist: cffi==1.17.1; extra == "pdfminer"
|
156
156
|
Requires-Dist: pycparser==2.22; extra == "pdfminer"
|
157
157
|
Provides-Extra: pillow
|
@@ -3,7 +3,7 @@ sbase/__main__.py,sha256=G0bVB1-DM4PGwQ1KyOupaWCs4ePbChZNNWuX2htim5U,647
|
|
3
3
|
sbase/steps.py,sha256=_WvAjydKqZfTdnZW9LPKkRty-g-lfdUPmLqnZj6ulcs,43013
|
4
4
|
seleniumbase/__init__.py,sha256=JFEY9P5QJqsa1M6ghzLMH2eIPQyh85iglCaQwg8Y8z4,2498
|
5
5
|
seleniumbase/__main__.py,sha256=dn1p6dgCchmcH1zzTzzQvFwwdQQqnTGH6ULV9m4hv24,654
|
6
|
-
seleniumbase/__version__.py,sha256=
|
6
|
+
seleniumbase/__version__.py,sha256=MFyo4pDjqCdo5BRjj7N--xl3zEwe6MjORQGypNDZpgY,46
|
7
7
|
seleniumbase/behave/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
seleniumbase/behave/behave_helper.py,sha256=elkl8P9eLulRAioLstE9baYNM9N_PHBmAOcajX-pH_Y,24198
|
9
9
|
seleniumbase/behave/behave_sb.py,sha256=qQF85LoohJBfrPK5ZcPi50v-pWtOrC9qcN1B3Ki_3tY,59401
|
@@ -36,7 +36,7 @@ seleniumbase/console_scripts/sb_print.py,sha256=tNy-bMDgwHJO3bZxMpmo9weSE8uhbH0C
|
|
36
36
|
seleniumbase/console_scripts/sb_recorder.py,sha256=fnHb5-kh11Hit-E9Ha-e4QXzqLcZvtij6mb5qNd4B1Q,11032
|
37
37
|
seleniumbase/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
38
|
seleniumbase/core/application_manager.py,sha256=e_0sjtI8cjY5BNyZj1QBR0j6_oCScxGmSXYEpcYwuZE,576
|
39
|
-
seleniumbase/core/browser_launcher.py,sha256=
|
39
|
+
seleniumbase/core/browser_launcher.py,sha256=6kEbWiagi1QnqauuuYT9nN-Jp9KBKGOhL2FAYYv6eqM,236976
|
40
40
|
seleniumbase/core/capabilities_parser.py,sha256=meIS2uHapTCq2ldfNAToC7r0cKmZDRXuYNKExM1GHDY,6038
|
41
41
|
seleniumbase/core/colored_traceback.py,sha256=DrRWfg7XEnKcgY59Xj7Jdk09H-XqHYBSUpB-DiZt6iY,2020
|
42
42
|
seleniumbase/core/create_db_tables.sql,sha256=VWPtrdiW_HQ6yETHjqTu-VIrTwvd8I8o1NfBeaVSHpU,972
|
@@ -50,7 +50,7 @@ seleniumbase/core/proxy_helper.py,sha256=4VkpMwavz0fx8wcOqJ_jyBT0HIXwcxmAcpd1gjJ
|
|
50
50
|
seleniumbase/core/recorder_helper.py,sha256=fNGjbapXmEsht54x1o6Igk198QdnPxDDnjUOzQxNhNQ,25055
|
51
51
|
seleniumbase/core/report_helper.py,sha256=AIl6Qava2yW1uSzbLpJBlPlYDz0KE-rVhogh8hsGWBo,12201
|
52
52
|
seleniumbase/core/s3_manager.py,sha256=bkeI8I4y19ebWuQG1oEZV5qJbotC6eN8vin31OCNWJk,3521
|
53
|
-
seleniumbase/core/sb_cdp.py,sha256=
|
53
|
+
seleniumbase/core/sb_cdp.py,sha256=aX2QSQUVo2rxEGYmiGCON5gH3sBqM_oQu66EoFLCKpg,83497
|
54
54
|
seleniumbase/core/sb_driver.py,sha256=yvTDRblBzG6bDX7XcLiAA6QcBelSJj_HHL_04lcfeeE,13760
|
55
55
|
seleniumbase/core/session_helper.py,sha256=s9zD3PVZEWVzG2h81cCUskbNWLfdjC_LwwQjKptHCak,558
|
56
56
|
seleniumbase/core/settings_parser.py,sha256=gqVohHVlE_5L5Cqe2L24uYrRzvoK-saX8E_Df7_-_3I,7609
|
@@ -65,7 +65,7 @@ seleniumbase/extensions/disable_csp.zip,sha256=5RvomXnm2PdivUVcxTV6jfvD8WhTEsQYH
|
|
65
65
|
seleniumbase/extensions/recorder.zip,sha256=OOyzF-Ize2cSRu1CqhzSAq5vusI9hqLLd2OIApUHesI,11918
|
66
66
|
seleniumbase/extensions/sbase_ext.zip,sha256=3s1N8zrVaMz8RQEOIoBzC3KDjtmHwVZRvVsX25Odr_s,8175
|
67
67
|
seleniumbase/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
68
|
-
seleniumbase/fixtures/base_case.py,sha256=
|
68
|
+
seleniumbase/fixtures/base_case.py,sha256=TrrdGGSZnEgBJ1UeBWq8bmv-98nugNCljYFb31JHxnY,722475
|
69
69
|
seleniumbase/fixtures/constants.py,sha256=WMrItuNyKq3XVJ64NluLIRc4gJCxDw8K8qXED0b9S2w,13752
|
70
70
|
seleniumbase/fixtures/css_to_xpath.py,sha256=9ouDB1xl4MJ2os6JOgTIAyHKOQfuxtxvXC3O5hSnEKA,1954
|
71
71
|
seleniumbase/fixtures/errors.py,sha256=KyxuEVx_e3MPhVrJfNIa_3ltMpbCFxfy_jxK8RFNTns,555
|
@@ -115,12 +115,12 @@ seleniumbase/undetected/reactor.py,sha256=NropaXcO54pzmDq6quR27qPJxab6636H7LRAaq
|
|
115
115
|
seleniumbase/undetected/webelement.py,sha256=OOpUYbEiOG52KsYYyuDW9tYLdA2SMnukvwQHUdPVn9E,1389
|
116
116
|
seleniumbase/undetected/cdp_driver/__init__.py,sha256=Ga9alwuaZZy4_XOShc0HjgFnNqpPdrcbjAicz5gE7a4,215
|
117
117
|
seleniumbase/undetected/cdp_driver/_contradict.py,sha256=lP4b0h5quAy573ETn_TBbYV889cL1AuPLVInpJ0ZkiU,3183
|
118
|
-
seleniumbase/undetected/cdp_driver/browser.py,sha256=
|
118
|
+
seleniumbase/undetected/cdp_driver/browser.py,sha256=Gr6uM15r1HInQ0UqHWfVTXI9Znpkt4LXGz44XykXq_k,30457
|
119
119
|
seleniumbase/undetected/cdp_driver/cdp_util.py,sha256=6-0-Dq_dFAOXQ5_a58i9y93zRqWUrjWoy6Pf_xBoveE,21648
|
120
120
|
seleniumbase/undetected/cdp_driver/config.py,sha256=t8KV1Vqa5SQRBq3-gjkHHmj9h85AplAM01asO3AWufs,12507
|
121
|
-
seleniumbase/undetected/cdp_driver/connection.py,sha256=
|
121
|
+
seleniumbase/undetected/cdp_driver/connection.py,sha256=_ounWzQ1m3_t-zJVgOAU2RINiKphfJkw2Qbu-zIoHC0,23359
|
122
122
|
seleniumbase/undetected/cdp_driver/element.py,sha256=FIC6v7OmumLCT-_vIc3H4oju_oBbaLpWJUJIKm2c_q4,40467
|
123
|
-
seleniumbase/undetected/cdp_driver/tab.py,sha256=
|
123
|
+
seleniumbase/undetected/cdp_driver/tab.py,sha256=4fRB9OtiMx23r79a2aJKlEhCkP3E_JVGD_7EvJ3srxo,50944
|
124
124
|
seleniumbase/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
125
125
|
seleniumbase/utilities/selenium_grid/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
126
126
|
seleniumbase/utilities/selenium_grid/download_selenium_server.py,sha256=ZdoInIbhtmdKCIPxxtJHhd2sqotqcNXWMYbwWrkh9O0,1727
|
@@ -135,9 +135,9 @@ seleniumbase/utilities/selenium_grid/start-grid-hub.bat,sha256=Ftq-GrAKRYH2ssDPr
|
|
135
135
|
seleniumbase/utilities/selenium_grid/start-grid-hub.sh,sha256=KADv0RUHONLL2_I443QFK8PryBpDmKn5Gy0s4o0vDSM,106
|
136
136
|
seleniumbase/utilities/selenium_ide/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
137
137
|
seleniumbase/utilities/selenium_ide/convert_ide.py,sha256=pZFnqEJQEKZPyNFjkLD29s2HPQgCrWW9XJWpCPhWOoM,31691
|
138
|
-
seleniumbase-4.35.
|
139
|
-
seleniumbase-4.35.
|
140
|
-
seleniumbase-4.35.
|
141
|
-
seleniumbase-4.35.
|
142
|
-
seleniumbase-4.35.
|
143
|
-
seleniumbase-4.35.
|
138
|
+
seleniumbase-4.35.3.dist-info/LICENSE,sha256=BRblZsX7HyPUjQmYTiyWr_e9tzWvmR3R4SFclM2R3W0,1085
|
139
|
+
seleniumbase-4.35.3.dist-info/METADATA,sha256=1hFGA_spM6YoDi_pFVzaeCWRxiBOncSlfGziDDCmuhU,86525
|
140
|
+
seleniumbase-4.35.3.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
141
|
+
seleniumbase-4.35.3.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
|
142
|
+
seleniumbase-4.35.3.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
|
143
|
+
seleniumbase-4.35.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|