Back to Devexpress

Switch Frames

testcafestudio-400175-test-actions-switch-frames.md

latest1.7 KB
Original Source

Switch Frames

  • Jul 30, 2021

Switch actions allow you to change the test’s execution context.

Switch to Iframe

Switch to Main Window

TestCafe Studio automatically adds Switch actions to the test when you interact with an iframe during test recording.

Switch to Iframe

Corresponding TestCafe API method: t.switchToIframe().

The Switch to Iframe action switches the test’s browsing context to a specified iframe. TestCafe Studio performs the subsequent test actions in this iframe until it reaches the Switch to Main Window action in the test.

ParameterDescription
Element SelectorIdentifies an iframe on the tested page.

Switch to Main Window

Corresponding TestCafe API method: t.switchToMainWindow()

The Switch to Main Window action switches the test’s browsing context from an iframe back to the main window.

Note

TestCafe Studio displays warnings when you reorder Switch Frames actions or move test actions between browsing contexts. After dragging, make sure the actions relate to their appropriate contexts. Otherwise, they can be executed incorrectly.