Skip to main content

YAML-Based Capability Overrides for Selenium Tests on HyperExecute

In Selenium-based testing, capabilities are key-value pairs that define how and where your tests should runβ€”such as browser type, version, OS, console logs, video recording, and more.

Previously, these capabilities were typically defined within the test script. With this new feature, you can now override or inject these directly from your HyperExecute YAML file. This gives you greater flexibility and eliminates the need to modify test scripts every time you change execution parameters.

πŸš€ Why Use YAML-Based Overrides?​

BenefitDescription
No Code Changes RequiredEasily change capabilities without modifying your test script.
Reusable & ConfigurableUse a single script across different environments with varying YAML files.
Cleaner Test ScriptsKeeps your scripts capability-agnostic and environment-independent.

βš™οΈ How It Works​

  • Define a new ltOptions section inside your HyperExecute YAML file.
  • Specify any desired capabilities as key-value pairs under ltOptions.
  • During test execution, HyperExecute automatically merges these with the final capabilities passed to the Selenium session.

All the capabilities defined under the ltOptions section are fully aligned with LambdaTest's standard capability structure. You can use any capability listed in our LambdaTest Capabilities Generator.

πŸ”‘ Key Behavior Rules​

CaseBehavior
Capability present in both test script and YAMLThe YAML value takes precedence.
Capability present in YAML but not in scriptIt is automatically added to the session capabilities.
Capability only in scriptUsed as-is unless overridden in YAML.

πŸ“ Note: This feature is only supported for Selenium-based tests at the moment.

Sample YAML with Capability Overrides​

hyperexecute.yaml
loading...

πŸ’‘ Common Use Cases​

Use CaseExample Capability
Changing browser type/versionbrowserName, version
Controlling visual artifactsvideo, console, visual
Defining test metadatabuild, name
Network capture and debuggingnetwork, tunnel
Switching Selenium versionsselenium_version

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles