View logs of TestCloud execution via Studio
This document shows you how to get test artifacts for each TestCloud test execution via Katalon Studio.
- Get the
executionSessionId
:- For Desktop Browser or Mobile Browser tests, you can find the
executionSessionId
in the Console Log after executing the test. - For Mobile Native App tests, add the following script to the end of the test case to extract the
executionSessionId
. After the test execution, you can find theexecutionSessionId
in the Console Log.import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory
import org.openqa.selenium.Capabilities
import io.appium.java_client.AppiumDriver
AppiumDriver<?> driver = MobileDriverFactory.getDriver();
Capabilities actualCapabilities = driver.getCapabilities();
KeywordUtil.logInfo("Execution Session ID: " + actualCapabilities.getCapability("kt:requestId"))
- For Desktop Browser or Mobile Browser tests, you can find the
- In your API testing tool, send the following command to authenticate to Katalon API to get an access token:
curl --location 'https://api.katalon.com/v1/auth/login' \
--header 'Content-Type: application/json' \
--data '{
"email": "<your-email>",
"password": "<your-password>"
}'This will return an authorization token that you will use to get the test artifacts.
Get session outputs
- Use the following API endpoint to get the test output ID of the given
executionSessionId
.https://testcloud.katalon.com/ees/sessions/{sessionId}/outputs?action=DOWNLOAD
- HTTP Method: GET
- Authentication: Bearer Token
sessionId
parameter: The uniqueexecutionSessionId
from Step 1.
For example, this requesthttps://testcloud.katalon.com/ees/sessions/3e3b8783-e624-45e7-9d7f-f0a6a39f26d7/outputs?action=DOWNLOAD
will return the following output. The highlighted ID is theoutputId
we need:
Download a specific test artifact
- Use the following API endpoint to download the available specific artifact, such as a device log, Appium log or media files:
https://testcloud.katalon.com/ees/sessions/outputs/{outputId}
- HTTP Method: GET
- Authentication: Bearer Token
outputId
parameter: The unique ID of the output file, which you can find in the response from the download request.
For example,https://testcloud.katalon.com/ees/sessions/outputs/3ca98950-f6a7-4621-b054-141d214d12b4
.