For the complete documentation index, see llms.txt. This page is also available as Markdown.

Advanced Test Capabilities

TestFirst Editor supports advanced testing scenarios that go beyond basic automation.

You can simulate real-world user behaviour, handle multiple sessions, and build dynamic, reusable tests, all within a single flow.

Multi-Tab & Multi-Window Testing

You can work with multiple tabs and browser instances in the same test.

This allows you to automate complex scenarios such as:

  • Navigating across multiple pages

  • Comparing views in parallel

  • Simulating multiple users or sessions

Multi-Tab Example

Scenario: Work with multiple tabs
    Given browser "Chrome"
    When I visit "https://www.testfirst.com"
    And I click "!See What’s New"
    And I switch to the new tab remembering it as "whats-new"
    And I visit "https://www.testfirst.com/plans" in a new tab
    And I remember the new tab as "plans"
    And I switch to the tab remembered as "plans"

Multi-Window Example

What You Can Do

  • Open and switch between tabs

  • Launch multiple browser instances

  • Switch across tabs and instances

  • Close tabs and sessions when done

💡 Always name tabs and browser instances for reliable switching.


Data-Driven Testing with Variables

Use variables to make your tests dynamic and reusable.

Example

Benefits

  • Avoid hardcoded values

  • Reuse tests across environments

  • Improve maintainability


Reusable Logic with Fragments

Fragments allow you to reuse common steps across multiple test cases.

Example

Use Cases

  • Login flows

  • Setup steps

  • Repeated navigation

See Fragments for full details.


Dynamic Data Handling

You can generate, capture, and validate values during execution.

Example

Use Cases

  • Unique data creation

  • Capturing UI values

  • Validating dynamic content

Best Practices

  • Keep flows readable with clear naming

  • Use variables instead of hardcoding

  • Extract repeated logic into fragments

  • Clean up tabs and browser instances


iFrame Support

TestFirst supports testing applications that use iFrames, including nested and embedded iFrame content.

Elements inside iFrames can be interacted with the same way as elements on the main page, whether tests are recorded using the Recorder or written manually using Gherkin.

Automatic iFrame Handling

TestFirst automatically detects and handles iFrame boundaries during recording and execution.

In most cases, users do not need to manually switch into frames. Tests transparently pass through iFrame boundaries, including cross-origin iFrames, allowing elements inside iFrames to behave as if they were part of the main page.

This allows you to:

  • Record interactions inside embedded frames reliably

  • Execute tests across nested iFrame structures

  • Work with pages containing multiple frames with similar elements

  • Replay Recorder-generated tests across iFrame boundaries automatically

Example

In this example, the button exists inside an iFrame, but no manual frame switching is required.

Current Automatic Handling Limits

Automatic iFrame traversal currently supports:

  • Up to 20 visible iFrames per page

  • Up to 3 nested iFrame levels

For more complex applications, manual iFrame handling can be used.


Improved / Manual iFrame Handling

Although iFrame handling is automatic in most cases, users can explicitly focus test execution on a specific iFrame when needed.

This can be useful for:

  • Very complex applications

  • Large pages with many iFrame elements

  • Improving selector precision

  • Working around automatic traversal limits

  • Deeply nested iFrame structures

Switch to a Frame

Use frame switching when you want to interact with elements inside a specific iFrame.

Example

Work with Nested Frames

TestFirst also supports nested iFrames (iFrames inside other iFrames).

Example

Remember Frames

You can remember frames by name and switch back to them later.

This is useful for complex applications with multiple frame contexts.

Example

Return to the Root Frame

Use the root frame command to exit iFrame context and return to the main page.

Example


Summary

Advanced capabilities allow you to:

  • Handle multi-tab and multi-window flows

  • Build dynamic, data-driven tests

  • Reuse logic using fragments

  • Automate complex real-world scenarios

Last updated