Skip to main content

Basic Configuration for Web GUI

SHAFT auto-generates a default custom.properties file on your first test run. Use it to tailor browser selection, timeouts, and reporting without touching your test code.

tip

All properties can also be set programmatically or overridden via Maven -D flags. See Programmatic Config and Properties Reference.


Target Browser

src/main/resources/properties/custom.properties
# Supported values: CHROME | FIREFOX | SAFARI | MICROSOFTEDGE
targetBrowserName=CHROME

# Run without a visible browser window (faster, ideal for CI/CD)
headlessExecution=true

Override from the command line without changing the file:

mvn test -DtargetBrowserName=FIREFOX -DheadlessExecution=true

Base URL and Timeouts

src/main/resources/properties/custom.properties
# Used as a prefix when you call driver.browser().navigateToURL("/path")
baseURL=https://staging.example.com

# Time (seconds) SHAFT will retry finding an element before failing
defaultElementIdentificationTimeout=30

# Time (seconds) for default UI state waits such as driver.element().waitUntil(...)
waitForUiStateTimeout=600

# Enable SHAFT's browser readiness wait before browser and element actions
waitForLazyLoading=true

# Time (seconds) to wait for document, JS framework, and network readiness
waitForLazyLoadingTimeout=30

# Initial network quiet window when no activity has been observed yet
lazyLoadingNetworkIdleInitialObservationMillis=200

# Required network quiet window after observed XHR/fetch/resource activity
lazyLoadingNetworkIdleQuietWindowMillis=500

# Time (seconds) to wait for a page navigation to complete
browserNavigationTimeout=60

# Time (seconds) to wait for the full page DOM to load
pageLoadTimeout=60

Visual Reporting

src/main/resources/properties/custom.properties
# Let the granular visual reporting controls below override the default profile
evidenceLevel=CUSTOM

# Generate an animated GIF of each test in the Allure report
createAnimatedGif=true

# Record a full MP4 video of each test execution
videoParams_recordVideo=true

# Keep the Allure 3 Awesome report portable as one HTML file
allure.singleFile=true

# Group the Allure report tree by Java package and class
allure.groupBy=package,testClass

Reliability & Retries

src/main/resources/properties/custom.properties
# Automatically retry failed tests up to N times
retryMaximumNumberOfAttempts=3

# Retries are additional attempts after the first failure; JUnit retries run
# after @AfterEach cleanup and execute @BeforeEach again

# Loosen the built-in pre-action checks if your app has unusual rendering
forceCheckForElementVisibility=false
forceCheckElementLocatorIsUnique=false
forceCheckTextWasTypedCorrectly=false
forceCheckNavigationWasSuccessful=false

# Use JavaScript click as a fallback when a WebDriver click fails
clickUsingJavascriptWhenWebDriverClickFails=true

Proxy

Only needed if you are behind a corporate proxy:

src/main/resources/properties/custom.properties
com.SHAFT.proxySettings=proxy.corp.example.com:8080