iframe options 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 tag
<iframe src="http://kidcreatorsteam.com" height="90px" width="40px"></iframe>
Example 3: html iframe example
<iframe src="http://www.codegrepper.com"></iframe>
Example 4: iframe html
<iframe id="inlineFrameExample"
title="Inline Frame Example"
height="200"
style="border: 0px;width: 100%;"
src="https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik">
</iframe>
Example 5: iframe attributes
<iframe width="560" height="315" src="https://www.youtube.com/embed/owsfdh4gxyc" frameborder="0" allowfullscreen></iframe>
Example 6: how to handle iframes
- 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();