iframe website code example

Example 1: iframe

<!DOCTYPE html>
<html>

<body>
    <iframe src="https://comercioiturama.blogspot.com/" width="800" height="600"></iframe>
</body>

</html>

Example 2: html iframe example

<iframe src="http://www.codegrepper.com"></iframe>

Example 3: iframe in html

<iframe src="yourURL" height="200" width="300"></iframe>

Example 4: put html in iframe

<iframe srcdoc="<html><body>Hello, <b>world</b>.</body></html>"></iframe>

Example 5: what is iframe

- Iframe is html inside another html
	- We need to switch selenium focus to iframe
	  either by using INDEX, NAME-ID, or 	
	  as a webelement same way as other webelements.
		
  After switching to Iframe we need to switch back to
  the main frame to able to continue in the main frame.
  
  
  Syntax=
  
  -driver.switchTo().defaultContent();
  -driver.switchTo().parentFrame();

Tags:

Html Example