Best Answer · By JanBask QA Expert
Answered on Dec 10, 2019
To touch base with frame elements, switching to frame and its content is the prerequisite. It is equivalent to switching to a separate page as a prerequisite of its interaction. Consider the command:
driver.switchTo().frame(i);
… Here “i” is the zero-based index of the frame. The frame function integrates with the name, ID and reference of searched elements.
The defaultContent method is used to rollback back to the default frame. Below command is the way to move the content to the default frame.
driver.switchTo().defaultContent();