Class SeleniumCoverageIntegration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classChrome browser coverage state for one Selenium browser session.static final classEdge browser coverage state for one Selenium browser session.static final classFirefox browser coverage state for one Selenium browser session. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigureCdpBaggageHeader(org.openqa.selenium.chromium.HasCdp browser) Configures a Chrome or Edge browser session to inject the current test'sBaggageheader using Chrome DevTools Protocol instead of a proxy.static voidconfigureCdpBaggageHeader(org.openqa.selenium.chromium.HasCdp browser, String baggageHeader) Configures a Chrome or Edge browser session to inject the suppliedBaggageheader using Chrome DevTools Protocol instead of a proxy.static voidconfigureCdpHeaders(org.openqa.selenium.chromium.HasCdp browser, Map<String, String> headers) Configures a Chrome or Edge browser session to inject the supplied HTTP headers using Chrome DevTools Protocol instead of a proxy.static ParasoftHeaderInjectingProxyconfigureChromeOptions(org.openqa.selenium.chrome.ChromeOptions options) Starts a Parasoft header-injecting proxy using the current test's baggage header and configures the supplied Chrome options to use it.static ParasoftHeaderInjectingProxyconfigureChromeOptions(org.openqa.selenium.chrome.ChromeOptions options, ParasoftHeaderInjectingProxy proxy) Configures the supplied Chrome options to use an existing Parasoft header-injecting proxy.static ParasoftHeaderInjectingProxyconfigureChromeOptions(org.openqa.selenium.chrome.ChromeOptions options, AtomicReference<String> baggageHeader) Starts a Parasoft header-injecting proxy using a shared baggage reference and configures the supplied Chrome options to use it.static ParasoftHeaderInjectingProxyconfigureEdgeOptions(org.openqa.selenium.edge.EdgeOptions options) Starts a Parasoft header-injecting proxy using the current test's baggage header and configures the supplied Edge options to use it.static ParasoftHeaderInjectingProxyconfigureEdgeOptions(org.openqa.selenium.edge.EdgeOptions options, ParasoftHeaderInjectingProxy proxy) Configures the supplied Edge options to use an existing Parasoft header-injecting proxy.static ParasoftHeaderInjectingProxyconfigureEdgeOptions(org.openqa.selenium.edge.EdgeOptions options, AtomicReference<String> baggageHeader) Starts a Parasoft header-injecting proxy using a shared baggage reference and configures the supplied Edge options to use it.static ParasoftHeaderInjectingProxyconfigureFirefoxOptions(org.openqa.selenium.firefox.FirefoxOptions options) Starts a Parasoft header-injecting proxy using the current test's baggage header and configures the supplied Firefox options to use it.static ParasoftHeaderInjectingProxyconfigureFirefoxOptions(org.openqa.selenium.firefox.FirefoxOptions options, ParasoftHeaderInjectingProxy proxy) Configures the supplied Firefox options to use an existing Parasoft header-injecting proxy.static ParasoftHeaderInjectingProxyconfigureFirefoxOptions(org.openqa.selenium.firefox.FirefoxOptions options, AtomicReference<String> baggageHeader) Starts a Parasoft header-injecting proxy using a shared baggage reference and configures the supplied Firefox options to use it.configureProxyBaggageHeader(org.openqa.selenium.chrome.ChromeOptions options) Configures the supplied Chrome options with a dedicated Parasoft header-injecting proxy for one browser session.configureProxyBaggageHeader(org.openqa.selenium.edge.EdgeOptions options) Configures the supplied Edge options with a dedicated Parasoft header-injecting proxy for one browser session.configureProxyBaggageHeader(org.openqa.selenium.firefox.FirefoxOptions options) Configures the supplied Firefox options with a dedicated Parasoft header-injecting proxy for one browser session.Creates Chrome options configured with a dedicated Parasoft header-injecting proxy for one browser session.Creates Edge options configured with a dedicated Parasoft header-injecting proxy for one browser session.Creates Firefox options configured with a dedicated Parasoft header-injecting proxy for one browser session.
-
Method Details
-
createChromeProxyConfig
Creates Chrome options configured with a dedicated Parasoft header-injecting proxy for one browser session.Call this method separately for each browser. The proxy captures the current test's baggage header when the browser options are created, so parallel browsers keep independent proxy and baggage state.
- Returns:
- browser coverage handle that must be closed after the browser session ends
-
configureProxyBaggageHeader
public static SeleniumCoverageIntegration.ChromeCoverageConfig configureProxyBaggageHeader(org.openqa.selenium.chrome.ChromeOptions options) Configures the supplied Chrome options with a dedicated Parasoft header-injecting proxy for one browser session.Call this method separately for each browser. The proxy captures the current test's baggage header when the browser options are configured, so parallel browsers keep independent proxy and baggage state.
- Parameters:
options- Chrome options to configure- Returns:
- browser coverage handle that must be closed after the browser session ends
-
createEdgeProxyConfig
Creates Edge options configured with a dedicated Parasoft header-injecting proxy for one browser session.Call this method separately for each browser. The proxy captures the current test's baggage header when the browser options are created, so parallel browsers keep independent proxy and baggage state.
- Returns:
- Edge browser coverage handle that must be closed after the browser session ends
-
configureProxyBaggageHeader
public static SeleniumCoverageIntegration.EdgeCoverageConfig configureProxyBaggageHeader(org.openqa.selenium.edge.EdgeOptions options) Configures the supplied Edge options with a dedicated Parasoft header-injecting proxy for one browser session.Call this method separately for each browser. The proxy captures the current test's baggage header when the browser options are configured, so parallel browsers keep independent proxy and baggage state.
- Parameters:
options- Edge options to configure- Returns:
- Edge browser coverage handle that must be closed after the browser session ends
-
createFirefoxProxyConfig
Creates Firefox options configured with a dedicated Parasoft header-injecting proxy for one browser session.Call this method separately for each browser. The proxy captures the current test's baggage header when the browser options are created, so parallel browsers keep independent proxy and baggage state.
- Returns:
- Firefox browser coverage handle that must be closed after the browser session ends
-
configureProxyBaggageHeader
public static SeleniumCoverageIntegration.FirefoxCoverageConfig configureProxyBaggageHeader(org.openqa.selenium.firefox.FirefoxOptions options) Configures the supplied Firefox options with a dedicated Parasoft header-injecting proxy for one browser session.Call this method separately for each browser. The proxy captures the current test's baggage header when the browser options are configured, so parallel browsers keep independent proxy and baggage state.
- Parameters:
options- Firefox options to configure- Returns:
- Firefox browser coverage handle that must be closed after the browser session ends
-
configureCdpBaggageHeader
public static void configureCdpBaggageHeader(org.openqa.selenium.chromium.HasCdp browser) Configures a Chrome or Edge browser session to inject the current test'sBaggageheader using Chrome DevTools Protocol instead of a proxy.Call this method after creating the
WebDriversession and before navigating to the application under test. Call it separately for each browser session used by parallel tests.- Parameters:
browser- Chrome or Edge driver that supports CDP
-
configureCdpBaggageHeader
public static void configureCdpBaggageHeader(org.openqa.selenium.chromium.HasCdp browser, String baggageHeader) Configures a Chrome or Edge browser session to inject the suppliedBaggageheader using Chrome DevTools Protocol instead of a proxy.Passing
nullor a blank value clears previously configured extra HTTP headers for this CDP session.- Parameters:
browser- Chrome or Edge driver that supports CDPbaggageHeader- baggage value to inject, such astest-operator-id=userIdortest-operator-id=userId+parallelId
-
configureCdpHeaders
public static void configureCdpHeaders(org.openqa.selenium.chromium.HasCdp browser, Map<String, String> headers) Configures a Chrome or Edge browser session to inject the supplied HTTP headers using Chrome DevTools Protocol instead of a proxy.Passing
nullclears previously configured extra HTTP headers for this CDP session.- Parameters:
browser- Chrome or Edge driver that supports CDPheaders- HTTP headers to inject
-
configureChromeOptions
public static ParasoftHeaderInjectingProxy configureChromeOptions(org.openqa.selenium.chrome.ChromeOptions options) Starts a Parasoft header-injecting proxy using the current test's baggage header and configures the supplied Chrome options to use it.- Parameters:
options- Chrome options to configure- Returns:
- proxy handle that must be closed after the browser session ends
-
configureChromeOptions
public static ParasoftHeaderInjectingProxy configureChromeOptions(org.openqa.selenium.chrome.ChromeOptions options, AtomicReference<String> baggageHeader) Starts a Parasoft header-injecting proxy using a shared baggage reference and configures the supplied Chrome options to use it.- Parameters:
options- Chrome options to configurebaggageHeader- shared baggage value to inject, such astest-operator-id=userId+parallelId- Returns:
- proxy handle that must be closed after the browser session ends
-
configureChromeOptions
public static ParasoftHeaderInjectingProxy configureChromeOptions(org.openqa.selenium.chrome.ChromeOptions options, ParasoftHeaderInjectingProxy proxy) Configures the supplied Chrome options to use an existing Parasoft header-injecting proxy.- Parameters:
options- Chrome options to configureproxy- Parasoft proxy to use- Returns:
- the supplied proxy
-
configureEdgeOptions
public static ParasoftHeaderInjectingProxy configureEdgeOptions(org.openqa.selenium.edge.EdgeOptions options) Starts a Parasoft header-injecting proxy using the current test's baggage header and configures the supplied Edge options to use it.- Parameters:
options- Edge options to configure- Returns:
- proxy handle that must be closed after the browser session ends
-
configureEdgeOptions
public static ParasoftHeaderInjectingProxy configureEdgeOptions(org.openqa.selenium.edge.EdgeOptions options, AtomicReference<String> baggageHeader) Starts a Parasoft header-injecting proxy using a shared baggage reference and configures the supplied Edge options to use it.- Parameters:
options- Edge options to configurebaggageHeader- shared baggage value to inject, such astest-operator-id=userId+parallelId- Returns:
- proxy handle that must be closed after the browser session ends
-
configureEdgeOptions
public static ParasoftHeaderInjectingProxy configureEdgeOptions(org.openqa.selenium.edge.EdgeOptions options, ParasoftHeaderInjectingProxy proxy) Configures the supplied Edge options to use an existing Parasoft header-injecting proxy.- Parameters:
options- Edge options to configureproxy- Parasoft proxy to use- Returns:
- the supplied proxy
-
configureFirefoxOptions
public static ParasoftHeaderInjectingProxy configureFirefoxOptions(org.openqa.selenium.firefox.FirefoxOptions options) Starts a Parasoft header-injecting proxy using the current test's baggage header and configures the supplied Firefox options to use it.- Parameters:
options- Firefox options to configure- Returns:
- proxy handle that must be closed after the browser session ends
-
configureFirefoxOptions
public static ParasoftHeaderInjectingProxy configureFirefoxOptions(org.openqa.selenium.firefox.FirefoxOptions options, AtomicReference<String> baggageHeader) Starts a Parasoft header-injecting proxy using a shared baggage reference and configures the supplied Firefox options to use it.- Parameters:
options- Firefox options to configurebaggageHeader- shared baggage value to inject, such astest-operator-id=userId+parallelId- Returns:
- proxy handle that must be closed after the browser session ends
-
configureFirefoxOptions
public static ParasoftHeaderInjectingProxy configureFirefoxOptions(org.openqa.selenium.firefox.FirefoxOptions options, ParasoftHeaderInjectingProxy proxy) Configures the supplied Firefox options to use an existing Parasoft header-injecting proxy.- Parameters:
options- Firefox options to configureproxy- Parasoft proxy to use- Returns:
- the supplied proxy
-