While performing Selenium test automation, you’d often come across scenarios where you’d need to handle frames or iframes. Frames are used to split the content into horizontal and vertical splits, while iframes are used to embed content on a web page.

In this Protractor testing tutorial, I’ll take a look at how to handle frames and iframes in Selenium with Protractor. To learn more about Protractor, and how to perform Protractor testing, you can refer to this Protractor testing tutorial to perform cross-browser testing.

Difference Between iFrames And Frames

Frames are used for horizontally and vertically splitting of the screen while iFrames are used to insert content from other sources, such as advertisements on your websites.

The frame is an HTML tag used to split the same web page or domain into separate frames /or windows. Frames are used along with framesets, the < frame > tag in a web page defines each of the frames inside the frameset file tag and so we can say that the framesets include several frames.

In Protractor, you can[ handle iFrames and Frames in Protractor]in the same way.

Some major differences between frames and iFrames are:

  • The frame requires the presence of a frameset, but iframes do not need a frameset.
  • The frames do not contain or support nested frames (frames within frames), but iFrames do contain nested iFrames.
  • The regulation of height and width of the frame is complicated as opposed to iFrame.
  • The placing of frames is a bit challenging compared to iFrames.
  • The frames are not allowed in HTML5, but it allows iFrames.

#javascript #tutorial #performance #javascript framework #protractor #iframes

Protractor Tutorial: Handling iFrames and Frames in Selenium
1.75 GEEK