Elements in Frames

Let's write a UI test for a playground-app element inside an iframe.

iframe

First, we need to create a root Home page object and add a frame element:

Use enterFrame() in this JavaScript test to enter the frame.

The Playground page object for our playground-app, which is in the iframe, should be marked as root.

Now, when the JavaScript test enters the frame, we can load the Playground page object from the UTAM loader:

When the test is done interacting with the Playground page object inside the frame, call exitFrame:

If the frame is nested, a test can use utam.exitParentFrame() to pass the control to the parent frame of the current frame.