+20
-1
lines changedFilter options
+20
-1
lines changed Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1
+
Selenium (TBA next version)
2
+
* Fix frame_to_be_available_and_switch_to_it() for string inputs (#10963)
3
+
1
4
Selenium 4.4.3
2
5
* Update explicit dependency for certifi to remove upper bound (#10956)
3
6
Original file line number Diff line number Diff line change
@@ -252,7 +252,7 @@ def frame_to_be_available_and_switch_to_it(locator):
252
252
253
253
def _predicate(driver):
254
254
try:
255
-
if hasattr(locator, '__iter__'):
255
+
if hasattr(locator, '__iter__') and not isinstance(locator, str):
256
256
driver.switch_to.frame(driver.find_element(*locator))
257
257
else:
258
258
driver.switch_to.frame(locator)
Original file line number Diff line number Diff line change
@@ -351,6 +351,22 @@ def test_should_be_able_to_switch_to_the_top_if_the_frame_is_deleted_from_under_
351
351
WebDriverWait(driver, 3).until(EC.presence_of_element_located((By.ID, "success")))
352
352
353
353
354
+
def test_frame_to_be_available_and_switch_to_it_using_string_inputs(driver, pages):
355
+
# Similar to above test, but using `iframe = "iframe1"` instead of `iframe = 0`
356
+
pages.load("frame_switching_tests/deletingFrame.html")
357
+
iframe = "iframe1"
358
+
WebDriverWait(driver, 3).until(EC.frame_to_be_available_and_switch_to_it(iframe))
359
+
# we should be in the frame now
360
+
killIframe = driver.find_element(By.ID, "killIframe")
361
+
killIframe.click()
362
+
driver.switch_to.default_content()
363
+
364
+
addIFrame = driver.find_element(By.ID, "addBackFrame")
365
+
addIFrame.click()
366
+
WebDriverWait(driver, 3).until(EC.frame_to_be_available_and_switch_to_it(iframe))
367
+
WebDriverWait(driver, 3).until(EC.presence_of_element_located((By.ID, "success")))
368
+
369
+
354
370
def test_should_be_able_to_switch_to_the_top_if_the_frame_is_deleted_from_under_us_with_webelement(driver, pages):
355
371
pages.load("frame_switching_tests/deletingFrame.html")
356
372
iframe = driver.find_element(By.ID, "iframe1")
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4