Skip to content

Commit a297051

Browse files
committed
Scroll to iframes before switching into them
1 parent 17add19 commit a297051

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,6 +1687,11 @@ def switch_to_frame(self, frame, timeout=None):
16871687
timeout = settings.SMALL_TIMEOUT
16881688
if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
16891689
timeout = self.__get_new_timeout(timeout)
1690+
if self.is_element_visible(frame):
1691+
try:
1692+
self.scroll_to(frame, timeout=1)
1693+
except Exception:
1694+
pass
16901695
page_actions.switch_to_frame(self.driver, frame, timeout)
16911696

16921697
def switch_to_default_content(self):

0 commit comments

Comments
 (0)