Article From:

iframe(locatorThere are three scenarios: the driver. find_element_by_xpath()), the name of the frame, and the subscript index.

driver.switch_to.frame(locator)   #Switch iframe

driver.switch_to.parent_frame()  #This method is suitable for nested iframe. When you have a parent iframe and a child iframe, then your current location is a child iframe. If you want to switch back to the parent iframe, you need to use switch_to..parent_frame() ,Back to parent iframe

driver.switch_to.default_content()  #Back to the outermost HTML


Waiting method can switch iframe automatically


Link of this Article: Iframe switching

Leave a Reply

Your email address will not be published. Required fields are marked *