+91 88606 33966            edu_sales@siriam.in                   Job Opening : On-site Functional Trainer/Instructor | Supply Chain Management (SCM)
How to Handle IFrames in Selenium

This article explains how to identify and count the number of iframes (inline frames) present on a webpage using Selenium WebDriver. Two methods are used:

  1. Locating all









    File iframe1.html






    IFrame 1


    IFrame 1: Greetings


    Hello from IFrame 1!




    File: iframe2.html






    IFrame 2


    IFrame 2: Message


    Welcome to IFrame 2!




    2. Create a Python file

    • Import the necessary libraries
    • Create an instance of the browser
    • Navigate to the target URL

    3. Finding all iframe elements using the