Skip to main content

🔩 Configuration File

The framework is highly configurable. You can configure repeated setting for your test in the framework configuration file.

Configuration File​

info

When you create the Boyka project using the command line assistant, the config file gets created automatically at src/test/resources/ folder.

caution

Boyka framework is driven by boyka-config.json configuration file. You must have this file in order to use the framework.

Configuration is stored in boyka-config.json file. This file is in JSON format. It will be automatically created when you initialize the new project using Boyka command line assistant.

Following is the logic which Boyka-framework will use to find the config file:

  • First it will check for the config folder in the BOYKA_CONFIG_PATH environment variable
  • If the environment variable is not set, then it will check boyka.config.path system property
  • If the system property is not set, then by default, it will check in the src/test/resources folder of your root project path
danger

The Config file name cannot be modified. It should always be boyka-config.json

Configuration file sample​

Sample Config
boyka-config.json
{
"listeners_package": "io.github.boykaframework.testng.listeners",
"ui": {
"timeout": {
"implicit_wait": 10,
"explicit_wait": 30,
"page_load_timeout": 30,
"script_timeout": 10,
"highlight_delay": 100
},
"logging": {
"exclude_logs": ["bugreport"]
},
"screenshot": {
"enabled": true,
"path": "./screenshots",
"extension": "jpeg",
"prefix": "SCR"
},
"common_setting": {
"api": {
"logging": {
"request": true,
"response": true
},
"timeout": {
"read_timeout": 3,
"write_timeout": 3,
"connection_timeout": 5
},
"schema_path": "schema/"
}
},
"web": {
"test_local_chrome": {
"base_url": "http://the-internet.herokuapp.com/",
"browser": "CHROME",
"highlight": true,
"headless": false,
"resize": "CUSTOM",
"custom_size": {
"width": 1580,
"height": 1080
},
"browser_options": ["use-fake-device-for-media-stream", "use-fake-ui-for-media-stream"]
},
"test_local_firefox": {
"browser": "FIREFOX"
},
"test_local_edge": {
"browser": "EDGE",
"resize": "FULL_SCREEN"
},
"test_local_safari": {
"browser": "SAFARI"
},
"test_browserstack_chrome": {
"browser": "REMOTE",
"target": "BROWSER_STACK",
"user_name": "${env:BS_USER}",
"password": "${env:BS_KEY}",
"resize": "MAXIMIZED",
"capabilities": {
"browser": "Chrome",
"browserVersion": "latest",
"os": "Windows",
"osVersion": "11",
"resolution": "1920x1080",
"projectName": "Test Boyka Project",
"buildName": "Test BrowserStack Build",
"sessionName": "Test BrowserStack Session",
"seleniumVersion": "4.8.0",
"telemetryLogs": "true",
"seleniumLogs": "true",
"video": "true",
"networkLogs": "true",
"debug": "true"
}
},
"test_selenium_grid": {
"browser": "CHROME",
"target": "LOCAL",
"port": "4444"
},
"test_lambda_test_chrome": {
"browser": "REMOTE",
"target": "LAMBDA_TEST_WEB",
"user_name": "${env:LT_USER}",
"password": "${env:LT_KEY}",
"resize": "MINIMIZED",
"capabilities": {
"browserName": "Chrome",
"version": "99.0",
"platform": "Windows 10",
"resolution": "1920x1080",
"build": "Test LambdaTest Build",
"name": "Test LambdaTest Session",
"network": true,
"visual": true,
"video": true,
"console": true
}
}
},
"mobile": {
"test_local_sauce_android": {
"server": {
"target": "LOCAL",
"port": 4723,
"session_override": true,
"driver": "UI_AUTOMATOR",
"allow_insecure": ["get_server_logs", "chromedriver_autodownload"]
},
"device": {
"os": "ANDROID",
"version": "12",
"name": "Nexus_6",
"type": "VIRTUAL",
"server_install_timeout": 60,
"server_launch_timeout": 60,
"ignore_unimportant_views": true,
"full_reset": true,
"system_port": 8200,
"swipe": {
"distance": 50,
"max_swipe_until_found": 5
},
"application": {
"path": "/apps/android/sauce-demo.apk",
"wait_activity": "com.swaglabsmobileapp.MainActivity",
"install_timeout": 180,
"wait_timeout": 120
},
"video": {
"enabled": true,
"time_limit": 300,
"size": "800x720",
"android": {
"bit_rate": 4
}
},
"virtual_device": {
"name": "Nexus_6",
"headless": true
}
}
},
"test_bs_android": {
"server": {
"target": "BROWSER_STACK",
"user_name": "${env:BS_USER}",
"password": "${env:BS_KEY}",
"driver": "UI_AUTOMATOR"
},
"device": {
"os": "ANDROID",
"version": "11.0",
"name": "Google Pixel 5",
"type": "CLOUD",
"ignore_unimportant_views": true,
"application": {
"path": "AndroidApp",
"wait_activity": "com.swaglabsmobileapp.MainActivity",
"external": true,
"install_timeout": 180
},
"capabilities": {
"projectName": "BrowserStack Android Project",
"buildName": "Test BrowserStack Build",
"sessionName": "Test BrowserStack Session",
"appiumVersion": "2.0.0",
"automationVersion": "latest",
"deviceLogs": true,
"networkLogs": true,
"debug": true,
"video": true,
"appiumLogs": true
}
}
},
"test_lt_android": {
"server": {
"target": "LAMBDA_TEST_MOBILE",
"user_name": "${env:LT_USER}",
"password": "${env:LT_KEY}",
"driver": "UI_AUTOMATOR"
},
"device": {
"type": "CLOUD",
"application": {
"install_timeout": 180,
"wait_activity": "com.swaglabsmobileapp.MainActivity"
},
"ignore_unimportant_views": true,
"capabilities": {
"platformName": "Android",
"deviceName": "Pixel 5",
"platformVersion": "11",
"app": "${env:LT_APP_ANDROID}",
"project": "LambdaTest Android Project",
"build": "Test LambdaTest Build",
"name": "Test LambdaTest Session",
"devicelog": true,
"network": true,
"visual": true,
"video": true,
"autoGrantPermissions": true,
"autoAcceptAlerts": true,
"isRealMobile": true,
"w3c": true
}
}
},
"test_local_sauce_ios": {
"server": {
"target": "LOCAL",
"port": 4725,
"session_override": true,
"driver": "XCUI"
},
"device": {
"os": "IOS",
"version": "16.2",
"name": "iPhone 14",
"type": "VIRTUAL",
"server_install_timeout": 60,
"server_launch_timeout": 60,
"connect_keyboard": false,
"typing_speed": 25,
"swipe": {
"distance": 50,
"max_swipe_until_found": 5
},
"virtual_device": {
"headless": true,
"launch_timeout": 180
},
"video": {
"enabled": true,
"time_limit": 300,
"ios": {
"fps": 30
}
},
"wda": {
"launch_timeout": 120,
"connection_timeout": 120,
"local_port": 8100
},
"application": {
"path": "/apps/ios/sauce-demo.zip",
"install_timeout": 180
}
}
},
"test_bs_ios": {
"server": {
"target": "BROWSER_STACK",
"user_name": "${env:BS_USER}",
"password": "${env:BS_KEY}",
"driver": "XCUI"
},
"device": {
"os": "IOS",
"version": "16",
"name": "iPhone 14",
"type": "CLOUD",
"application": {
"path": "IOSApp",
"external": true,
"install_timeout": 180
},
"capabilities": {
"projectName": "BrowserStack iOS Project",
"buildName": "Test BrowserStack Build",
"sessionName": "Test BrowserStack Session",
"appiumVersion": "2.0.0",
"automationVersion": "latest",
"deviceLogs": true,
"networkLogs": true,
"debug": true,
"video": true,
"appiumLogs": true
}
}
},
"test_lt_ios": {
"server": {
"target": "LAMBDA_TEST_MOBILE",
"user_name": "${env:LT_USER}",
"password": "${env:LT_KEY}",
"driver": "XCUI"
},
"device": {
"type": "CLOUD",
"application": {
"install_timeout": 180
},
"ignore_unimportant_views": true,
"capabilities": {
"platformName": "iOS",
"deviceName": "iPhone 14",
"platformVersion": "16",
"app": "${env:LT_APP_IOS}",
"project": "LambdaTest iOS Project",
"build": "Test LambdaTest Build",
"name": "Test LambdaTest Session",
"devicelog": true,
"network": true,
"visual": true,
"video": true,
"autoGrantPermissions": true,
"autoAcceptAlerts": true,
"isRealMobile": true,
"w3c": true
}
}
}
}
},
"api": {
"test_restfulbooker": {
"base_uri": "https://restful-booker.herokuapp.com",
}
}
}

Configuration File properties​

PropertyDescriptionTypeDefault
uiContains UI platform specific configuration. See UI Config below.object
apiContains API platform specific configuration. See API config below.object
listeners_packageThis will be the package name under which all the Boyka framework listeners are saved.string
dataContains Test data related configurations. See Test data configuration belowTestDataSetting
common_settingContains Common settings for different platforms. See Common Setting configuration belowCommonSetting

UI Configuration​

PropertyDescriptionTypeDefault
timeoutContains timeout configuration. See Timeout Config below.TimeoutSetting
loggingContains logging specific configuration. See Logging Config belowLoggingSetting
screenshotContains screenshot configuration. See Screenshot Config below.ScreenshotSetting
webContains web platform configuration. See Web Config below.Map<String, WebSetting>
mobileContains Mobile platform configuration. See Mobile Config below.object
delayContains settings for delay between actions. See DelaySettingsDelaySetting
Web Configuration

In ui configuration block, you can provide different versions of web settings having different key names under web object.

See the example in sample configuration file.

Timeout Configuration​

PropertyDescriptionTypeDefault
implicit_waitImplicit wait for finding the elements on UI (in seconds).number1
explicit_waitExplicit wait for finding the elements on UI (in seconds).number1
page_load_timeoutPage load timeout for waiting for page to load (in seconds).number30
script_timeoutScript timeout for waiting for page to load (in seconds).number30
highlight_delayDelay for element getting highlightedlong100

UI Logging Configuration​

PropertyDescriptionTypeDefault
enableDetermines whether logging is enabled for the frameworkbooleantrue
exclude_logsExclude any specific logs which is supported by DriversList<string>null
pathPath where the logs will be savedstring{root-folder}/logs

Screenshot Configuration​

PropertyDescriptionTypeDefault
enabledEnable/disable screenshot capturingbooleantrue
pathPath to the directory where screenshots are storedstring./screenshots
extensionExtension of the screenshot filestringjpeg
prefixPrefix of the screenshot filestringSCR

Delay Configuration​

PropertyDescriptionTypeDefault
before_clickDelay before clicking on an elementint0
before_mouse_moveDelay before moving the mouseint0
before_swipeDelay before swipingint500
before_tapDelay before tapping on an elementint0
before_typingDelay before typing any textint0

Web Configuration​

PropertyDescriptionTypeDefault
base_urlBase URL to navigate to by defaultstringnull
browserBrowser nameBrowserBrowser.NONE
versionBrowser Versionstringstable
protocolProtocol type, will override Host provided by Target providerProtocolProtocol.HTTP
hostRemote driver host name, will override Host provided by Target providerstringnull
portRemote driver port, if 0, port will not be considerednumber0
targetTarget provider nameTargetProvidersTargetProviders.LOCAL
platformPlatform name for the Browserstringnull
user_nameUser name for cloud service providerstringnull
passwordPassword / Access key for cloud service providerstringnull
capabilitiesCapabilities for browserMap<String, Object>null
headlessHeadless mode for browserbooleantrue
highlightHighlight element on interaction, if truebooleanfalse
resizeHow to resize the window initial stateWindowResizeTypeWindowResizeType.NORMAL
custom_sizeCustom window size, when resize option is selected as CUSTOMDimension1920x1080
page_load_strategyPage loading strategy (all in capital letters)PageLoadStrategyNORMAL
browser_optionsAn array of browser specific argumentsstring[]null
experimental_optionsA key-value pair of Browsers Experimental optionsMap<string, object>null
info

You can use Environment variables for user_name and password by using ${env:ENV_NAME} format

tip

When you use Boyka command line assistant to configure your test to run on any Cloud providers using boyka config [web | api | android | ios] [config_name] command, then it is MANDATORY to provide Environment variable names when prompted for user name and password

warning

Browser options and Experimental options is not supported for Safari browser.

Please raise a new feature request along with sample example test and options support that is required

Mobile Configuration​

PropertyDescriptionTypeDefault
serverContains Appium Server related configurationsServerSetting
deviceContains Mobile test device related configurationsDeviceSetting
Appium Server Configuration​
PropertyDescriptionTypeDefault
protocolProtocol type of the server hostProtocolHTTP
hostHost of the serverstring
portPort on which server will runint
base_pathBase path of the serverstring
externalSet true if using already running server, else framework will start the server automaticallybooleanfalse
session_overrideEnables session overridebooleanfalse
node_pathNode executable pathstring
appium_pathAppium executable main.js pathstring
targetTarget provider nameTargetProvidersTargetProviders.LOCAL
user_nameUser name for cloud service providerstringnull
passwordPassword / Access key for cloud service providerstringnull
allow_insecureAllow list of features in server considered as insecureList<string>
timeoutTimeout in seconds for server to startint30
driverAppium automation driver typeAutomationTypenull
allow_corsIf set to true, will enable CORSbooleanfalse
callback_addressCallback IP addressstringnull
callback_portCallback Port numberint0
deny_insecureSet which insecure features are not allowed to run in this server's sessionsList<string>null
keep_alive_timeoutNumber of seconds the Appium server should apply as both the keep-alive timeout and the connection timeout for all requestsint0
loggingLogging related settingsLogSettingnull
pluginsUse a single or a list of Appium pluginsList<string>null
relaxed_securityDisable additional security checks, so it is possible to use some advanced features, provided by drivers supporting this optionbooleanfalse
strict_capabilitiesCause sessions to fail if desired caps are sent in that Appium does not recognize as valid for the selected devicebooleanfalse
webhookAlso send log output to this http listenerstringnull
other_argsAny other Appium server arguments which is currently not supported by Boyka, you can use them in this settingMap<string, string>null
Server Logging Setting​
PropertyDescriptionTypeDefault
debug_spacingAdd exaggerated spacing in logs to help with visual inspectionbooleanfalse
levelLog levelLogLevelINFO
local_timezoneUse local timezone for timestampsbooleanfalse
timestampShow timestamps in console outputbooleanfalse
info

You can use Environment variables for user_name and password by using ${env:ENV_NAME} format

tip

When you use Boyka command line assistant to configure your test to run on any Cloud providers using boyka config [web | api | android | ios] [config_name] command, then it is MANDATORY to provide Environment variable names when prompted for user name and password

Mobile Device Configuration​
PropertyDescriptionTypeDefault
nameDevice Namestring
osDevice OS typeOSANDROID
versionDevice OS versionstring
typeDevice typeDeviceTypeVIRTUAL
capabilitiesContains cloud specific capabilitiesMap
applicationContains application related configsApplicationSetting
virtual_deviceContains virtual device specific configsVirtualDeviceSetting
clear_filesDetermines if system files needs to cleared after run completes on a devicebooleantrue
clear_logsDetermines if device logs needs to be clearedbooleantrue
full_resetDetermines if full reset needs to be doneboolean
no_resetDetermines if there should be no resetboolean
accept_alertsDetermines if auto accept alerts is neededbooleantrue
ignore_unimportant_viewsDetermines if unimportant views needs to be ignoredbooleantrue
server_install_timeoutTimeout in seconds to wait for Appium server app to get installedint30
server_launch_timeoutTimeout in seconds to wait for Appium server app to startint30
adb_timeoutTimeout in seconds to wait for ADB commands to get executedint30
swipeSwipe specific settingSwipeSetting
wdaWebDriverAgent specific settings for iOSWDASetting
typing_speedMax typing speed for iOSint60
chrome_driver_portChrome driver port for Android devicesint0
system_portSystem port for Android devicesint8200
unique_idDevice UDIDstringnull
videoVideo recording related settingsVideoSettingnull
Device Application Configurations​
PropertyDescriptionTypeDefault
base_urlBase URL to navigate to by defaultstringnull
browserBrowser name.Browsernull
externalIs the app saved outside src/test/resources folder?booleanfalse
pathPath to the AUT, can also contain environment variables for cloud App URLstring
typeApplication typeApplicationTypeNATIVE
install_timeoutTimeout in seconds to wait until app gets installed on deviceint30
wait_activityWait for the mentioned activity to loadstring
wait_timeoutWait timeout in seconds to wait for AUTint30
bundle_idiOS application bundle idstringnull
chrome_driver_portPort on which Chrome driver would runint0
Virtual Device Configurations​
PropertyDescriptionTypeDefault
nameName of AVDstring
launch_timeoutTimeout in seconds to wait until AVD launchesint60
headlessDetermine if required to run in headless modebooleanfalse
ready_timeoutTimeout in seconds to wait until AVD is readyint60
connect_keyboardShould iOS simulator connect to hardware keyboard?booleanfalse
Swipe Configuration​
PropertyDescriptionTypeDefault
distanceAmount of distance to swipe from the center of the screen to the edge of the screen or elementint25
max_swipe_until_foundMaximum amount of time to swipe until an element is found on the screenint5
speedSpeed of swipe actionSpeedFAST
Swipe Speed​
  • FAST: Speed of 100ms is used while swiping
  • NORMAL: Speed of 500ms is used while swiping
  • SLOW: Speed of 1000ms is used while swiping
WebDriverAgent Configuration​
PropertyDescriptionTypeDefault
local_portThis value, if specified, will be used to forward traffic from Mac host to real ios devices over USB. Default value is the same as the port number used by WDA on the device under testint8100
use_newIf true, forces uninstall of any existing WebDriverAgent app on devicebooleanfalse
launch_timeoutTimeout to wait for WebDriverAgent to be pingableint60
startup_retriesNumber of times to try to build and launch WebDriverAgent onto the deviceint2
connection_timeoutConnection timeout to wait for a response from WebDriverAgentint60
startup_retry_intervalTime interval to wait between tries to build and launch WebDriverAgentint10
use_prebuiltIf true, uses existing WebDriverAgent app on devicebooleanfalse
update_bundle_idBundle id to update WDA to before building and launching on real devices. This bundle id must be associated with a valid provisioning profilestringnull
team_idApple developer team identifier string. Must be used in conjunction with xcodeSigningId to take effect. e.g., JWL241K123stringnull
signing_idString representing a signing certificate. Must be used in conjunction with xcodeOrgId. This is usually just iPhone Developerstringnull
Video recording Configuration​
PropertyDescriptionTypeDefault
enabledSet it to true to enable video recording for Mobile automationbooleanfalse
pathPath to the folder where video recording will be savedstring./videos
prefixPrefix for the video file namestringVID
sizeSize of the video screen in WIDTHxHEIGHTstringnull
time_limitTime limit of the video recording. Maximum 30 mins of recording is supportedinteger0
androidAndroid specific video record settingsAndroidVideoSettingdefault instance
iosiOS specific video record settingsIOSVideoSettingdefault instance
Android video recording configurations​
PropertyDescriptionTypeDefault
bit_rateBit rate of video recording. Value will be internally multiplied by 100000int4
iOS video recording configurations​
PropertyDescriptionTypeDefault
fpsFrames per second between range of 1 to 60int10
codecVideo codec type to be used for encoding the video. Use the value from the output of command ffmpeg -codecsstringmpeg4
qualityVideo encoding quality. It can be any of LOW, MEDIUM, HIGH, PHOTOio.appium.java_client.ios.IOSStartScreenRecordingOptions.VideoQualityMEDIUM

API Configuration​

Common Configuration​

PropertyDescriptionTypeDefault
apiContains Common API settingsCommonApiSetting

Common API Configuration​

PropertyDescriptionTypeDefault
base_pathBase path of the API.string
timeoutTimeout specific settingsTimeoutSetting
loggingLogging configuration. See Logging Config below.object
schema_pathPath of schema file at location src/test/resourcesstring
validate_sslIf set to true, SSL validation will happenbooleantrue
verify_host_nameIf set to true, host name verification will happenbooleantrue
apiDifferent API ConfigurationsApiSetting

Specific API Configuration​

PropertyDescriptionTypeDefault
base_uriBase URL of the API.string
base_pathBase path of the API.string
portPort of the API.number
timeoutTimeout specific settingsTimeoutSetting
loggingLogging configuration. See Logging Config below.object
schema_pathPath of schema file at location src/test/resourcesstring
validate_sslIf set to true, SSL validation will happenbooleantrue
verify_host_nameIf set to true, host name verification will happenbooleantrue
API Configuration

In api configuration block, you can provide different versions of API settings having different key names.

See the example in sample configuration file.

Tip!

If any setting is missing in the API block, the common API setting will be used.

Timeout Configurations​

PropertyDescriptionTypeDefault
connection_timeoutConnection timeout in seconds for the API.number5
read_timeoutRead timeout in seconds for the API.number5
write_timeoutWrite timeout in seconds for the API.number5

Test Data Configuration​

PropertyDescriptionTypeDefault
pathPath to the folder of test datastringtest-data
externalIf false, by default test data path will be searched in src/test/resourcesbooleanfalse
typeType of test data fileTestDataSourceEXCEL
extensionTest data file extensionstringxlsx

Logging Configuration​

PropertyDescriptionTypeDefault
requestLog request information.booleantrue
responseLog response information.booleantrue

Supported Browsers​

We have an enum Browser where we maintain the list of supported browsers. They are:

  • CHROME: Is used for Chrome browser.
  • EDGE: Is used for Edge browser.
  • FIREFOX: Is used for Firefox browser.
  • NONE: No browser will be used.
  • REMOTE: Is used for Cloud based browsers.
  • SAFARI: Is used for Safari browser.
danger

Browsers are case sensitive, so make sure you provide exact names in the config.

Supported Protocols​

We have an enum Protocol where we maintain the list of supported protocols. They are:

  • HTTP: Is used for HTTP protocol.
  • HTTPS: Is used for HTTPS protocol.

Target Providers​

We have an enum TargetProviders where we maintain the list of supported target providers. They are:

  • LOCAL: Local provider will be used.
  • BROWSER_STACK: Is used for BrowserStack cloud provider.
  • LAMBDA_TEST_WEB: Is used for LambdaTest cloud provider to run on Web browsers.
  • LAMBDA_TEST_MOBILE: Is used for LambdaTest cloud provider to run on Mobile devices.
tip

Host name from the settings will be used by default, if that is not provided, the host name from the TargetProviders name.

Supported Device OS​

We have an enum OS where we maintain the list of currently supported device OS types. They are:

  • ANDROID
  • IOS

Supported device types​

  • CLOUD
  • VIRTUAL

Supported Automation types​

  • UI_AUTOMATOR: Equivalent for UIAutomator2 in Appium
  • XCUI: Equivalent for XCuiTest in Appium

Supported Server Log levels​

  • DEBUG
  • DEBUG_DEBUG
  • DEBUG_ERROR
  • DEBUG_INFO
  • DEBUG_WARN
  • ERROR
  • ERROR_DEBUG
  • ERROR_ERROR
  • ERROR_INFO
  • ERROR_WARN
  • INFO
  • INFO_DEBUG
  • INFO_ERROR
  • INFO_INFO
  • INFO_WARN
  • WARN
  • WARN_DEBUG
  • WARN_ERROR
  • WARN_INFO
  • WARN_WARN

Window Resize Types​

  • CUSTOM: You can define custom window size
  • FULL_SCREEN: Opens the window in full screen mode
  • MAXIMIZED: Opens the window maximized (if supported by your platform)
  • MINIMIZED: Opens the window minimized
  • NORMAL: Opens the window in default state

Supported Application Types​

  • NATIVE: Native Mobile application
  • HYBRID: Hybrid Mobile application
  • WEB: Web Mobile application

Test Data Source types​

  • EXCEL: Excel test data file