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?β
Benefit | Description |
---|---|
No Code Changes Required | Easily change capabilities without modifying your test script. |
Reusable & Configurable | Use a single script across different environments with varying YAML files. |
Cleaner Test Scripts | Keeps 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β
Case | Behavior |
---|---|
Capability present in both test script and YAML | The YAML value takes precedence. |
Capability present in YAML but not in script | It is automatically added to the session capabilities. |
Capability only in script | Used as-is unless overridden in YAML. |
π Note: This feature is only supported for Selenium-based tests at the moment.
Sample YAML with Capability Overridesβ
loading...
π‘ Common Use Casesβ
Use Case | Example Capability |
---|---|
Changing browser type/version | browserName , version |
Controlling visual artifacts | video , console , visual |
Defining test metadata | build , name |
Network capture and debugging | network , tunnel |
Switching Selenium versions | selenium_version |