Retrieve OS, browser and screen resolution of the machine perfoming tests

During or after test executions, you may want to capture additional information about OS, browser, and screen resolution of the machine performing tests. Below are some sample custom keywords to help you with this task:

package com.mycompany


import org.openqa.selenium.Capabilities
import org.openqa.selenium.WebDriver
import org.openqa.selenium.remote.RemoteWebDriver
import com.kms.katalon.core.webui.driver.DriverFactory
import java.awt.*

public class GetTestingConfig {
def getOperatingSystem () {
	println System.getProperty('')

def getBrowserAndVersion() {
	WebDriver driver = DriverFactory.getWebDriver()
	Capabilities caps = ((RemoteWebDriver) driver).getCapabilities()
	String browserName = caps.getBrowserName().capitalize()
	String browserVersion = caps.getVersion()
	println browserName + ' ' + browserVersion

def getScreenResolution() {
	Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize()
	Integer screenHeight = screenSize.height
	Integer screenWidth = screenSize.width
	println screenWidth + 'x' + screenHeight }


Credit to Drunda Ninbel