• What is Automation Testing - Advantages & Types of Tools
  • What is Selenium IDE, Selenium RC, Selenium WebDriver, Selenium Grid?
  • Selenium IDE, Firebug & Firepath Installation


  • Selenium WebDriver Architecture
  • Selenium Installation
  • Challenges and Limitations of Selenium
  • First Selenium WebDriver Script
  • Working with Firefox Browser
  • Solution - Failed To Launch Browser Using Selenium WebDriver
  • Working with Chrome Browser
  • Working with IE Browser
  • Difference Between FindElement & FindElements
  • Install Firebug, Fire path and other add on for Selenium
  • Locators in Selenium
  • Dynamic Xpath
  • Dynamic CSS
  • Handle drop-downs
  • How to work with file upload
  • Handle Alerts & Popups
  • Handle Multiple Windows
  • Mouse Hover event in Selenium
  • Right Click
  • Double Click
  • Drag and Drop
  • Capture Screenshots in Selenium
  • Parameterization
  • Synchronization
  • Implicit Wait, Explicit Wait and Fluent Wait in Selenium
  • Implicit Waits
  • Explicit WebDriver Waits
  • Fluent Wait In Selenium
  • Apache POI
  • How To Read Data From Excel File
  • How To Write Data In Excel File
  • Database Testing Using MSSQL
  • Database Testing Using MySQL
  • Database Testing Using DB2
  • Handle Ajax Call in Selenium
  • Listeners in Selenium
  • Handling JavaScript in Selenium
  • Stale Element Reference Exception in Selenium
  • Integrate Sikuli with Selenium
  • Headless Browser Testing 
  • Headless Browser Testing using HtmlUnitDriver
  • Headless Browser Testing using PhanthomJSDriver


  • TestNG Installation
  • TestNG Complete Tutorial


  • Extent Reports Introduction
  • Extent Reports Generation
  • Capturing Screenshots & Including In Extent Reports
  • Extent Reports Version 4


  • ANT Build Tool - How To Download & Install
  • Maven Build Tool - How To Download & Install
  • Creating Maven Selenium Project
  • GIT Integration with Selenium
  • Jenkins - How To Download & Install
  • Jenkins - Executing TestNG Scripts
  • Jenkins - Generating Reports After Test Execution
  • Jenkins - Executing Maven Project
  • Create build and Execute build for nightly execution
  • Send Email report based on build Status
  • Selenium Continuous Integration with Jenkins [Selenium – Maven – Git – Jenkins] – Step By Step Guide


  • Running Selenium Tests On BrowserStack
  • Kobiton - Mobile Testing Platform with Real Devices


  • Mobile Testing Platform with Real Devices


  • What is Framework & Types of Framework
  • Page Object Model Design Pattern
  • Data Driven Framework
  • How to explain Test Automation Framework or Selenium Automation Framework Architecture In Interview

  • API Testing:

  • Learn API Testing
  • Postman Tutorial (API Testing with Postman)


  • Test Automation Framework Interview Questions
  • Selenium Interview Questions
  • TestNG Interview Questions
  • Java Interview Questions
  • Python Interview Questions
  • API Testing Interview Questions


  • Automation Tester Resume
  • How to Switch Between IFrames Using Selenium Python

    A common type of control used on the website is HTML iframe. This control needs to be handled in a specific manner while testing. In this article, I will show you how to handle iframes using Selenium Python

    What is an iframe?

    An iframe (Inline Frame) is an HTML document embedded in another HTML document. The iframe HTML element is often used to insert the content from another source, such as an advertisement, into a Web page.

    How To Handle iframes Using Selenium Python

    We can handle iframes with Selenium WebDriver. In an HTML document, we can have web elements that are a part of another webpage. The iframe in an HTML document is described inside a <frame> or <iframe> tag. If there are multiple iframes, they are part of the <frameset> tag.

    An iframe can be identified on a web page with the help of its name, id, web element, or the index. To access an element inside an iframe, we have to switch the focus from the main page content to the specific iframe where the element is present.

    Let us consider a sample HTML code with frame/ iframe tag.

    To switch to a frame/ iframe with the value of the name attribute in the HTML, the syntax is:

    To switch to a frame/ iframe with the value of the id attribute in the HTML, the syntax is:

    We can switch to a frame/ iframe with the help of the locators like CSS or XPath. The locators like link text and partial link text do not work with the frames. Also, if the page contains multiple frames, then the tagname locator will not be able to identify a particular frame/ iframe we are looking for.

    To switch to a frame/ iframe using css, the syntax is 

    The syntax with XPath is

    To switch to a frame/ iframe with index, the syntax is:

    The index of a frame/ iframe starts from 0. All the frames/ iframes on a web page are assigned with an index.

    To switch the focus from all the frames/ iframes and move to the main web page, the method to be used is switch_to.default_content (). Once we shift out of the frame we can no longer access the elements inside the frame.

    Code Implementation with frame.

    Conclusion: Switching Between iframes using Selenium Python

    We face iframes many times while recording our selenium scripts. So it is very important to know how to handle switching between iframes using Selenium Python. Hope you got a clear idea on how to handle it now.

    If you have any other questions, please comment below. 


    Get our latest blog posts delivered to your inbox

    Subscribe and get popular blog posts about software testing industry.


    Leave a Comment

    Share via
    Copy link
    Powered by Social Snap