seleniumbase 4.34.11__py3-none-any.whl → 4.34.13__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
1
  # seleniumbase package
2
- __version__ = "4.34.11"
2
+ __version__ = "4.34.13"
@@ -220,6 +220,7 @@ def extend_driver(driver):
220
220
  driver.highlight_if_visible = DM.highlight_if_visible
221
221
  driver.sleep = time.sleep
222
222
  driver.get_attribute = DM.get_attribute
223
+ driver.get_parent = DM.get_parent
223
224
  driver.get_current_url = DM.get_current_url
224
225
  driver.get_page_source = DM.get_page_source
225
226
  driver.get_title = DM.get_title
@@ -647,6 +648,7 @@ def uc_open_with_cdp_mode(driver, url=None):
647
648
  cdp.click_if_visible = CDPM.click_if_visible
648
649
  cdp.click_visible_elements = CDPM.click_visible_elements
649
650
  cdp.mouse_click = CDPM.mouse_click
651
+ cdp.get_parent = CDPM.get_parent
650
652
  cdp.remove_element = CDPM.remove_element
651
653
  cdp.remove_from_dom = CDPM.remove_from_dom
652
654
  cdp.remove_elements = CDPM.remove_elements
@@ -5394,6 +5396,19 @@ def get_local_driver(
5394
5396
  )
5395
5397
  driver._is_hidden = (headless or headless2)
5396
5398
  driver._is_using_uc = True
5399
+ with suppress(Exception):
5400
+ if int(uc_driver_version) >= 133:
5401
+ for window_handle in driver.window_handles:
5402
+ driver.switch_to.window(window_handle)
5403
+ if driver.current_url.startswith(
5404
+ "chrome-extension://"
5405
+ ):
5406
+ driver.close()
5407
+ time.sleep(0.003)
5408
+ driver.switch_to.window(driver.window_handles[0])
5409
+ time.sleep(0.003)
5410
+ driver.connect()
5411
+ time.sleep(0.003)
5397
5412
  if mobile_emulator:
5398
5413
  uc_metrics = {}
5399
5414
  if (
@@ -40,7 +40,7 @@ def create_proxy_ext(
40
40
  """ mode: "fixed_servers",\n"""
41
41
  """ rules: {\n"""
42
42
  """ singleProxy: {\n"""
43
- """ scheme: ["http", "https", "socks4", "socks5"],\n"""
43
+ """ scheme: "http",\n"""
44
44
  """ host: "%s",\n"""
45
45
  """ port: parseInt("%s")\n"""
46
46
  """ },\n"""
@@ -91,6 +91,8 @@ class CDPMethods():
91
91
  element.get_attribute = (
92
92
  lambda attribute: self.__get_attribute(element, attribute)
93
93
  )
94
+ # element.get_parent() should come last
95
+ element.get_parent = lambda: self.__get_parent(element)
94
96
  return element
95
97
 
96
98
  def get(self, url):
@@ -549,6 +551,9 @@ class CDPMethods():
549
551
  pass
550
552
  return None
551
553
 
554
+ def __get_parent(self, element):
555
+ return self.__add_sync_methods(element.parent)
556
+
552
557
  def __get_x_scroll_offset(self):
553
558
  x_scroll_offset = self.loop.run_until_complete(
554
559
  self.page.evaluate("window.pageXOffset")
@@ -769,6 +774,11 @@ class CDPMethods():
769
774
  def highlight_overlay(self, selector):
770
775
  self.find_element(selector).highlight_overlay()
771
776
 
777
+ def get_parent(self, element):
778
+ if isinstance(element, str):
779
+ element = self.select(element)
780
+ return self.__add_sync_methods(element.parent)
781
+
772
782
  def remove_element(self, selector):
773
783
  self.select(selector).remove_from_dom()
774
784
 
@@ -51,6 +51,13 @@ class DriverMethods():
51
51
  element = self.locator(selector, by=by)
52
52
  return element.get_attribute(attribute)
53
53
 
54
+ def get_parent(self, element):
55
+ if self.__is_cdp_swap_needed():
56
+ return self.driver.cdp.get_parent(element)
57
+ if isinstance(element, str):
58
+ element = self.locator(element)
59
+ return element.find_element(by="xpath", value="..")
60
+
54
61
  def get_current_url(self):
55
62
  if self.__is_cdp_swap_needed():
56
63
  current_url = self.driver.cdp.get_current_url()
Binary file
Binary file
@@ -2072,6 +2072,19 @@ class BaseCase(unittest.TestCase):
2072
2072
  return
2073
2073
  self.set_attributes('[target="_blank"]', "target", "_self")
2074
2074
 
2075
+ def get_parent(self, element, by="css selector", timeout=None):
2076
+ """Returns the parent element.
2077
+ If element is a string, then finds element first via selector."""
2078
+ if self.__is_cdp_swap_needed():
2079
+ return self.cdp.get_parent(element)
2080
+ if isinstance(element, str):
2081
+ if not timeout:
2082
+ timeout = settings.LARGE_TIMEOUT
2083
+ element = self.wait_for_element_present(
2084
+ element, by=by, timeout=timeout
2085
+ )
2086
+ return element.find_element(by="xpath", value="..")
2087
+
2075
2088
  def get_property(
2076
2089
  self, selector, property, by="css selector", timeout=None
2077
2090
  ):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: seleniumbase
3
- Version: 4.34.11
3
+ Version: 4.34.13
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
@@ -59,7 +59,7 @@ Classifier: Topic :: Utilities
59
59
  Requires-Python: >=3.8
60
60
  Description-Content-Type: text/markdown
61
61
  License-File: LICENSE
62
- Requires-Dist: pip>=25.0
62
+ Requires-Dist: pip>=25.0.1
63
63
  Requires-Dist: packaging>=24.2
64
64
  Requires-Dist: setuptools~=70.2; python_version < "3.10"
65
65
  Requires-Dist: setuptools>=75.8.0; python_version >= "3.10"
@@ -132,7 +132,7 @@ Requires-Dist: allure-python-commons>=2.13.5; extra == "allure"
132
132
  Requires-Dist: allure-behave>=2.13.5; extra == "allure"
133
133
  Provides-Extra: coverage
134
134
  Requires-Dist: coverage>=7.6.1; python_version < "3.9" and extra == "coverage"
135
- Requires-Dist: coverage>=7.6.10; python_version >= "3.9" and extra == "coverage"
135
+ Requires-Dist: coverage>=7.6.12; python_version >= "3.9" and extra == "coverage"
136
136
  Requires-Dist: pytest-cov>=5.0.0; python_version < "3.9" and extra == "coverage"
137
137
  Requires-Dist: pytest-cov>=6.0.0; python_version >= "3.9" and extra == "coverage"
138
138
  Provides-Extra: flake8
@@ -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.0; python_version >= "3.9" and extra == "pdfminer"
154
+ Requires-Dist: cryptography==44.0.1; 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=OtJh8nGKL4xtZpw8KPqmn7Q6R-86t4cWUDyVF5MbMTo,2398
5
5
  seleniumbase/__main__.py,sha256=dn1p6dgCchmcH1zzTzzQvFwwdQQqnTGH6ULV9m4hv24,654
6
- seleniumbase/__version__.py,sha256=KR__znOpy5AsgsVWqz_LZ7sCHyKIhIAuRWYcx4McUwU,47
6
+ seleniumbase/__version__.py,sha256=YYjPJLYDtayyXhPQ09bUAAiLOtGfkQ7hldfDeirQdlc,47
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=L7pvPQDMoQ8Mh0rrv3xvVxqsaeavdNp9IShfHpn6DP0,234824
39
+ seleniumbase/core/browser_launcher.py,sha256=xkEcsdyz0E3acWgz_UYvrx6qMWUZT_IimhiJ885FVUw,235625
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
@@ -46,12 +46,12 @@ seleniumbase/core/encoded_images.py,sha256=rDKJ4cNJSuKiRcFViYU7bjyTS9_moI57gUPRX
46
46
  seleniumbase/core/jqc_helper.py,sha256=2DDQr9Q2jSSZqFzX588jLlUM9oJvyrRWq2aORSIPUdI,10322
47
47
  seleniumbase/core/log_helper.py,sha256=SW8wx2f2HfU3ERbANjxEC-jDbjy_IzaNYRKPlayfRRI,23442
48
48
  seleniumbase/core/mysql.py,sha256=8Fzj3p5dhtDWfMpFqFYxpSwa9s1UltiHsWJ56_aPOqk,3993
49
- seleniumbase/core/proxy_helper.py,sha256=nmZoQOhdejPlTwaXbGoAYPM9qOKszQMfia2utHWYoIQ,8298
49
+ seleniumbase/core/proxy_helper.py,sha256=kZnfkflB3XhuL2h-3inmx3UOLS8VAZ385BGCc4H8TvU,8267
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=R4EkU-2BaJZetebW4zYgYHp945LGmuNvHjVrKebA2wA,76378
54
- seleniumbase/core/sb_driver.py,sha256=NGa4adi8OAi2WFtFkEguXg3JCd1p-JuZweIpGNifEfU,13488
53
+ seleniumbase/core/sb_cdp.py,sha256=r9sv8WjwLhS_AFLn4QGLvbK4osfaC6ncRJRj0asrBvI,76754
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
57
57
  seleniumbase/core/style_sheet.py,sha256=QsfTBtgedfM3uTqgxtd53bhq202p9fwLMbFl9mPZgVg,11892
@@ -60,12 +60,12 @@ seleniumbase/core/tour_helper.py,sha256=kj2cz-DGKlw9SX3tWnVp-snpk6Flvqj81-xmKdKD
60
60
  seleniumbase/core/visual_helper.py,sha256=Dj5iJKw-bT_3e6KDqMf0sJi7xs_D96yqLcNc8fqhrjI,3408
61
61
  seleniumbase/drivers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
62
62
  seleniumbase/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
- seleniumbase/extensions/ad_block.zip,sha256=25YRmK3cSUUSYmyuksTxQnn6rIzCGY_MtaNlzr0fcxQ,11978
64
- seleniumbase/extensions/disable_csp.zip,sha256=YMifIIgEBiLrEFrS1sfW4Exh4br1V4oK1umHhtgduCU,11824
63
+ seleniumbase/extensions/ad_block.zip,sha256=LTlaOYUs6a1Zu4op64pLoDEqYKJb8zHq_Y0PsBIIqCk,1454
64
+ seleniumbase/extensions/disable_csp.zip,sha256=5RvomXnm2PdivUVcxTV6jfvD8WhTEsQYHaQZe7nk9Yc,20014
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=7fRj9u0zlOwsHpvyG5Oob7yXXWu8kt3sPAAAk4ZBfi8,721002
68
+ seleniumbase/fixtures/base_case.py,sha256=0bW99a1g8YH5YCXLnsJvZ5uSXvLOmY6QutDEpxDjX9U,721561
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
@@ -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.34.11.dist-info/LICENSE,sha256=BRblZsX7HyPUjQmYTiyWr_e9tzWvmR3R4SFclM2R3W0,1085
139
- seleniumbase-4.34.11.dist-info/METADATA,sha256=DpNE1EfE3UwG59LOPmCFF4mSoSw3arc0HVfPnY6TMo4,86520
140
- seleniumbase-4.34.11.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
141
- seleniumbase-4.34.11.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
142
- seleniumbase-4.34.11.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
143
- seleniumbase-4.34.11.dist-info/RECORD,,
138
+ seleniumbase-4.34.13.dist-info/LICENSE,sha256=BRblZsX7HyPUjQmYTiyWr_e9tzWvmR3R4SFclM2R3W0,1085
139
+ seleniumbase-4.34.13.dist-info/METADATA,sha256=3Tw5u_dBUmuIkyuwuwT4RPByNfWTA6BcWO8n7Ch3L40,86522
140
+ seleniumbase-4.34.13.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
141
+ seleniumbase-4.34.13.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
142
+ seleniumbase-4.34.13.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
143
+ seleniumbase-4.34.13.dist-info/RECORD,,