ralative path for screenshot in Jenkins stores file in installation directory


Using the above code line i try to safe the taken screenshot in the project folder, using relative path. This works fine for local executions.

Executing the test in Jenkins however, the screenshot is stored in the installation directory and not the project directory.

Is there a way to change this, where is my error?



You can get the path of the project directory by calling RunConfiguration.getProjectDir()

import com.kms.katalon.core.configuration.RunConfigurationdef projectDir = RunConfiguration.getProjectDir()WebUI.takeScreenshot(projectDir + '\\Screenshot\\scr.png')