From f3c80f7054c6571518665874c045db19408f183b Mon Sep 17 00:00:00 2001 From: Aman Chopra Date: Tue, 15 Jul 2025 15:17:21 +0530 Subject: [PATCH 1/2] yaml based overriding capabilities --- .../hyperexecute-yaml-capability-overrides.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 docs/hyperexecute-yaml-capability-overrides.md diff --git a/docs/hyperexecute-yaml-capability-overrides.md b/docs/hyperexecute-yaml-capability-overrides.md new file mode 100644 index 000000000..7db66ac5b --- /dev/null +++ b/docs/hyperexecute-yaml-capability-overrides.md @@ -0,0 +1,82 @@ +--- +id: hyperexecute-yaml-capability-overrides +title: YAML-Based Capability Overrides for Selenium Tests on HyperExecute +hide_title: false +sidebar_label: Override Capabilities in YAML +description: "Easily override test capabilities using YAML in HyperExecute. No script changes needed. Flexible, scalable, and ideal for dynamic test environments." +keywords: + - LambdaTest Hyperexecute + - LambdaTest Hyperexecute help + - LambdaTest Hyperexecute documentation +url: https://www.lambdatest.com/support/docs/hyperexecute-yaml-capability-overrides/ +site_name: LambdaTest Deep dive into hyperexecute yaml +slug: hyperexecute-yaml-capability-overrides/ +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + +In Selenium-based testing, [capabilities](https://www.lambdatest.com/support/docs/selenium-automation-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](https://www.lambdatest.com/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 + +```yaml reference title="hyperexecute.yaml" +https://github.com/LambdaTest/testng-selenium-hyperexecute-sample/blob/main/yaml/linux/v1/testng_hyperexecute_linux_ltoptions.yaml +``` + +## πŸ’‘ 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` | From 005ed8ee235a4e7732d1ea8298400f743cec2aeb Mon Sep 17 00:00:00 2001 From: Aman Chopra Date: Tue, 15 Jul 2025 15:17:32 +0530 Subject: [PATCH 2/2] added the sidebar --- sidebars.js | 1 + 1 file changed, 1 insertion(+) diff --git a/sidebars.js b/sidebars.js index 41546ec82..99a477fc4 100644 --- a/sidebars.js +++ b/sidebars.js @@ -49,6 +49,7 @@ module.exports = { "hyperexecute-snooper", "hyperexecute-inherit-config", "hyperexecute-yaml-version0.2", + "hyperexecute-yaml-capability-overrides" ], }, {