VOOZH about

URL: https://deepwiki.com/Accenture/Ocaramba/2.2-baseconfiguration-and-appsettings

⇱ BaseConfiguration and appsettings | Accenture/Ocaramba | DeepWiki


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

BaseConfiguration and appsettings

The BaseConfiguration class serves as the central configuration engine for Ocaramba. It leverages Microsoft.Extensions.Configuration to provide a unified, hierarchical access point for test settings defined in JSON files and environment variables OcarambaLite/BaseConfiguration.cs31-52 It abstracts the complexity of reading different configuration sections (like browser options, timeouts, and paths) and provides strongly-typed properties for the rest of the framework.

Configuration Architecture

Ocaramba uses a layered configuration approach. The BaseConfiguration class initializes a static IConfigurationRoot named Builder OcarambaLite/BaseConfiguration.cs49-52

Data Flow and Initialization

The configuration is built by loading files in the following order of precedence (later files override earlier ones):

  1. appsettings.json: The default configuration file containing base values OcarambaLite/BaseConfiguration.cs50
  2. appsettings.{Env}.json: Environment-specific overrides based on the ASPNETCORE_ENVIRONMENT variable OcarambaLite/BaseConfiguration.cs44-51
  3. Environment Variables: Can be used to inject values at runtime via the .NET configuration provider.

Configuration Mapping Diagram

This diagram shows how BaseConfiguration maps JSON keys to internal framework logic.

Configuration Mapping


Sources: OcarambaLite/BaseConfiguration.cs38-52 OcarambaLite/DriverContext.cs187

Supported Configuration Keys

The settings are primarily divided into the appSettings section for general framework behavior and browser-specific sections for driver-level customization.

Core Framework Settings (appSettings)

These keys reside under the "appSettings" node in the JSON files Ocaramba.Tests.NUnit/appsettings.json2-39

KeyDescriptionProperty in BaseConfiguration
browserTarget browser (e.g., Chrome, Firefox, RemoteWebDriver)TestBrowser OcarambaLite/BaseConfiguration.cs65-83
protocolApplication protocol (http/https)Protocol OcarambaLite/BaseConfiguration.cs132-143
hostBase domain for the application under testHost OcarambaLite/BaseConfiguration.cs148-159
urlFull URL if host/protocol are not usedUrl OcarambaLite/BaseConfiguration.cs164-175
longTimeoutMax wait time for long-running operations (seconds)LongTimeout
mediumTimeoutStandard wait time (seconds)MediumTimeout
shortTimeoutQuick check wait time (seconds)ShortTimeout
ImplicitlyWaitMillisecondsSelenium implicit wait settingImplicitlyWaitMilliseconds
SeleniumScreenShotEnabledGlobal toggle for capturing screenshots on failureSeleniumScreenShotEnabled
GetPageSourceEnabledGlobal toggle for saving HTML source on failureGetPageSourceEnabled
JavaScriptErrorLoggingEnables console error capture in ChromeJavaScriptErrorLogging
JavaScriptErrorTypesComma-separated list of JS errors to monitorJavaScriptErrorTypes Ocaramba.Tests.NUnit/appsettings.json34

Sources: OcarambaLite/BaseConfiguration.cs65-175 Ocaramba.Tests.NUnit/appsettings.json2-39

Driver Path and Executable Settings

These settings allow the framework to locate web drivers and browser binaries Ocaramba.Tests.NUnit/appsettings.json7-13

Platform-Specific Overrides (Linux)

Ocaramba supports cross-platform execution by utilizing the appsettings.Linux.json file. When the environment variable ASPNETCORE_ENVIRONMENT is set to Linux, the framework loads this file to override Windows-specific paths and settings OcarambaLite/BaseConfiguration.cs44-52

Typical overrides in appsettings.Linux.json include:

Environment Selection Logic


Sources: OcarambaLite/BaseConfiguration.cs44-52 Ocaramba.Tests.NUnit/appsettings.Linux.json1-63

Advanced Driver Configuration

Beyond simple key-value pairs, BaseConfiguration handles complex objects for browser customization.

Browser Arguments and Preferences

The framework reads sections for specific browsers to inject arguments into DriverOptions Ocaramba.Tests.NUnit/appsettings.json41-56

Remote Execution

When browser is set to RemoteWebDriver, the framework uses the following keys:

Extending Configuration

To add custom settings for a specific project:

  1. Add the key to the appSettings section of appsettings.json.
  2. Access the value via the static Builder property in BaseConfiguration OcarambaLite/BaseConfiguration.cs49-52

Example of framework internal access:


Internal Data Flow


Sources: OcarambaLite/DriverContext.cs101-102 OcarambaLite/BaseConfiguration.cs38-52 Ocaramba.Tests.NUnit/appsettings.json29