Skip to main content

Common Configuration Examples

Here are common scenarios and how to configure SHAFT properties for them. Each example shows three ways to configure properties: File-based, CLI-based, and Code-based.

Example 1: Run tests in headless mode on Firefox browser

To run tests in headless mode on Firefox, you need to set both targetBrowserName and headlessExecution properties:

src/main/resources/properties/custom.properties
targetBrowserName=firefox
headlessExecution=true

Example 2: Run tests on Chrome with mobile emulation

src/main/resources/properties/custom.properties
targetBrowserName=chrome
isMobileEmulation=true
mobileEmulation.deviceName=iPhone12Pro

Example 3: Remote execution on Selenium Grid

For remote execution on a Selenium Grid, you need to configure the execution address, target OS, and optionally enable headless mode:

tip

Learn how to set up your own local Selenium Grid in the Local Selenium Grid Execution guide.

src/main/resources/properties/custom.properties
executionAddress=192.168.1.100:4444
targetOperatingSystem=Linux
headlessExecution=true
targetBrowserName=chrome

Example 4: BrowserStack execution

For running tests on BrowserStack cloud platform:

src/main/resources/properties/custom.properties
executionAddress=browserstack
targetOperatingSystem=Windows
targetBrowserName=chrome
browserStack.userName=your_username
browserStack.accessKey=your_access_key
browserStack.osVersion=11
browserStack.browserVersion=latest

Example 5: Native mobile app testing (Android)

For testing native Android applications using Appium:

src/main/resources/properties/custom.properties
targetOperatingSystem=ANDROID
executionAddress=localhost:4723
mobile_platformVersion=13.0
mobile_deviceName=emulator-5554
mobile_automationName=UIAutomator2
mobile_app=src/test/resources/apps/ApiDemos-debug.apk
mobile_appPackage=io.appium.android.apis
mobile_appActivity=.view.Controls1

Example 6: Mobile web testing

For testing web applications on mobile browsers using Appium:

src/main/resources/properties/custom.properties
# Android Mobile Web
targetOperatingSystem=ANDROID
executionAddress=localhost:4723
mobile_platformVersion=13.0
mobile_deviceName=emulator-5554
mobile_automationName=UIAutomator2
browserName=chrome

# iOS Mobile Web (uncomment for iOS)
# targetOperatingSystem=IOS
# mobile_platformVersion=16.0
# mobile_deviceName=iPhone 14
# mobile_automationName=XCUITest
# browserName=safari

Example 7: Enable maximum performance mode

Maximum performance mode disables complementary features to achieve faster execution with up to 400% performance boost:

src/main/resources/properties/custom.properties
maximumPerformanceMode=2

Performance Mode Values:

  • 0 = Disabled (default)
  • 1 = Enabled without headless execution
  • 2 = Enabled with headless execution (fastest, ~400% performance boost)

Example 8: Cross-browser testing

Run the same test across multiple browsers sequentially or in parallel:

src/main/resources/properties/custom.properties
# Sequential execution across Chrome, Firefox, and Safari
SHAFT.CrossBrowserMode=sequential

# Parallel execution (requires Docker Desktop)
# SHAFT.CrossBrowserMode=parallelized

Cross-Browser Mode Values:

  • off = Normal execution with configured browser (default)
  • sequential = Tests run on Chrome, Firefox, and Safari in sequence
  • parallelized = Tests run on all three browsers in parallel
note

Cross-browser mode requires Docker Desktop to be installed and configured to use Linux images.


Example 9: API testing with Swagger validation

Enable Swagger/OpenAPI contract validation for API tests:

src/main/resources/properties/custom.properties
swagger.validation.enabled=true
swagger.validation.url=https://petstore.swagger.io/v2/swagger.json

Example 10: Screenshot and video recording configuration

Configure when and how to capture screenshots and videos:

src/main/resources/properties/custom.properties
# Screenshot configuration
screenshotParams_whenToTakeAScreenshot=Always
screenshotParams_screenshotType=FullPage
screenshotParams_highlightElements=true
screenshotParams_watermark=true

# Video recording
videoParams_recordVideo=true
videoParams_scope=DriverSession

# Animated GIF creation
createAnimatedGif=true
animatedGif_frameDelay=500

More Resources

For a complete list of all available properties, their default values, and descriptions, visit: