@@ -615,8 +615,8 @@ def find_visible_elements(self, selector, by=By.CSS_SELECTOR):
615
615
by = By .LINK_TEXT
616
616
return page_actions .find_visible_elements (self .driver , selector , by )
617
617
618
- def is_element_in_frame (self , selector , by = By .CSS_SELECTOR ):
619
- """ Returns True if the selector's element is located in an iFrame .
618
+ def is_element_in_an_iframe (self , selector , by = By .CSS_SELECTOR ):
619
+ """ Returns True if the selector's element is located in an iframe .
620
620
Otherwise returns False. """
621
621
selector , by = self ._recalculate_selector (selector , by )
622
622
if self .is_element_present (selector , by = by ):
@@ -639,10 +639,11 @@ def is_element_in_frame(self, selector, by=By.CSS_SELECTOR):
639
639
self .switch_to_default_content ()
640
640
return False
641
641
642
- def enter_frame_of_element (self , selector , by = By .CSS_SELECTOR ):
643
- """ Returns the frame name of the selector's element if in an iFrame.
644
- Also enters the iFrame if the element was inside an iFrame.
645
- If the element is not in an iFrame, returns None. """
642
+ def switch_to_frame_of_element (self , selector , by = By .CSS_SELECTOR ):
643
+ """ Set driver control to the iframe of the element (assuming the
644
+ element is in a single-nested iframe) and returns the iframe name.
645
+ If element is not in an iframe, returns None, and nothing happens.
646
+ May not work if multiple iframes are nested within each other. """
646
647
selector , by = self ._recalculate_selector (selector , by )
647
648
if self .is_element_present (selector , by = by ):
648
649
return None
0 commit comments