If you need to work with an iFrame, there are several methods you can use to select it:
- frame(index)
- frame(Name of Frame [or] Id of the frame)
- frame(WebElement frameElement)
- defaultContent()
Each time you want to interact with the content inside the frame, you will need to switch to it using one of the above methods.
In a C# example:-
driver.SwitchTo().Frame("top");
.... Perform your action on frame
driver.SwitchTo().defaultContent();
driver.SwitchTo().Frame("navigation");
.... Perform your action on frame
driver.SwitchTo().defaultContent();
....
To navigate through nested frames, find the hierarchy and switch from parent to child elements until you reach your target. Use Chrome Dev Tools to assist in identifying the hierarchy and performing operations within each frame before switching back to the default content.