Q:

what is iframe

<iframe src="http://kidcreatorsteam.com" height="90px" width="40px"></iframe>
<!--I made an iframe! Yay! -->
8
<div id="website_Within_Same_Webpage">
	<iframe src="https://www.codegrepper.com" 
        	height=200px width=100%>
	</iframe>
</div>
2
IFRAMES: stands for Inline Frame
    What is Iframe?
        It is basically HTML inside of another HTML
    How do we handle Iframe?
        - Selenium can only focus on one thing at time.
        - Therefore we need to switch the driver's focus to
        specific frame to be able to do any action in it.   
    
    syntax: driver.switchTo().frame();
    
    3 different ways of handling/switching to iframe
        - 3 ways to switch
   #1- byIndex: We pass the index number of desired web element.
      
   #2- id or name: We can pass id or name attribute value directly to switch.
      
 #3- WebElement: locate web element and pass WebElement value directly to switch.
        driver.switchTo().frame(WebElement);
1
<iframe src="http://www.codegrepper.com"></iframe>
6

    <iframe src="https://www.w3schools.com" title="W3Schools Free 
    Online Web Tutorials"></iframe>
 
0

<iframe src="demo_iframe.htm" height="200" width="300"></iframe> 
2

New to Communities?

Join the community