VOOZH about

URL: https://deepwiki.com/Accenture/Ocaramba/4.2-cloud-provider-testing:-browserstack-and-saucelabs

⇱ Cloud Provider Testing: BrowserStack and SauceLabs | Accenture/Ocaramba | DeepWiki


Loading...
Last indexed: 6 June 2026 (fb3580)
Menu

Cloud Provider Testing: BrowserStack and SauceLabs

Ocaramba provides integrated support for executing automated tests on cloud-based Selenium grids, specifically BrowserStack, SauceLabs, and TestingBot. This is achieved through dedicated test projects that leverage cloud-specific SDKs and capability injection to manage remote browser lifecycles and cross-browser compatibility.

BrowserStack Integration

The primary integration for BrowserStack is contained within the Ocaramba.Tests.BrowserStack project Ocaramba.Tests.BrowserStack/Ocaramba.Tests.BrowserStack.csproj1-56 This project utilizes the BrowserStack.TestAdapter NuGet package to manage the connection and reporting to the BrowserStack Automate platform Ocaramba.Tests.BrowserStack/Ocaramba.Tests.BrowserStack.csproj22

Configuration (browserstack.yml)

The BrowserStack SDK is configured via the browserstack.yml file Ocaramba.Tests.BrowserStack/browserstack.yml1-66 This file defines the credentials, project metadata, and the target platforms (browsers and devices) for execution.

Execution Flow

BrowserStack tests are executed using the browserstack-sdk CLI tool Ocaramba.Tests.BrowserStack/.config/dotnet-tools.json5-11 which wraps the standard dotnet test execution to inject the necessary cloud capabilities.

BrowserStack Execution Process


Sources: Ocaramba.Tests.BrowserStack/browserstack.yml50 Ocaramba.Tests.BrowserStack/.config/dotnet-tools.json5-11

Cloud Provider Cross-Browser Testing

The Ocaramba.Tests.CloudProviderCrossBrowser project is designed for generic cloud provider execution, including SauceLabs and TestingBot, by setting DriverCapabilities to CloudProvider Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.json15

Capability Injection and Test Base

The project uses ProjectTestBase to handle cloud-specific signaling via JavaScript execution on the remote driver.

The environments section in appsettings.json defines specific browser/OS combinations used for parallel execution via NUnit [TestFixture] attributes Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.json41-61 Ocaramba.Tests.CloudProviderCrossBrowser/Tests/HerokuappTestsNUnit.cs32-33

The set_AppConfig_for_tests.ps1 Script

To support dynamic CI/CD pipelines, Ocaramba uses the set_AppConfig_for_tests.ps1 script to modify configuration files at runtime. This script can update both legacy XML .config files and modern JSON appsettings.json files scripts/set_AppConfig_for_tests.ps136-112

ParameterDescription
OutDirThe directory containing the build artifacts scripts/set_AppConfig_for_tests.ps121
configNameThe name of the file to update (e.g., appsettings.json) scripts/set_AppConfig_for_tests.ps123
sectionThe JSON section or XML path to target scripts/set_AppConfig_for_tests.ps125
keysPipe-separated list of keys to update scripts/set_AppConfig_for_tests.ps127
valuesPipe-separated list of new values scripts/set_AppConfig_for_tests.ps129
-jsonSwitch to indicate the target is a JSON file scripts/set_AppConfig_for_tests.ps133

Data Flow: Capability Injection


Sources: scripts/set_AppConfig_for_tests.ps1108-110 Ocaramba.Tests.CloudProviderCrossBrowser/appsettings.json5-15 Ocaramba.Tests.CloudProviderCrossBrowser/ProjectTestBase.cs97

CI/CD Pipeline Orchestration

Cloud tests are triggered via specific PowerShell scripts within the CI workflows.

BrowserStack Execution Scripts

The framework provides scripts for both Windows and Linux environments to execute BrowserStack tests:

  • Windows: Scripts typically navigate to the build output directory and invoke the browserstack-sdk.
  • Linux: Scripts set the ASPNETCORE_ENVIRONMENT to "Linux" before running the SDK.

Log Aggregation

After execution, these scripts collect .log files and test results, compressing them into artifacts for post-test analysis.

Sources: