How you can interact with frame elements in Selenium?

801    Asked by DelbertRauch in QA Testing , Asked on Dec 10, 2019
Answered by Delbert Rauch

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();



Your Answer

Interviews

Parent Categories