ERROR: Job failed: command terminated with exit code 1 on Gitlab-ci

Hi, I am executing automation testing on my Test Suite Collection with gitlab-ci but just received an error message saying

“ERROR: Job failed: command terminated with exit code 1.”

However, I can execute the test suite collection locally without failure and gitlab runner log throws nothing during the execution:

--------------------------------------------------------------------------------
Test Suites/TIP/TIP Test Suite Collection - 20181217_083039..........11/11(100%)
--------------------------------------------------------------------------------
Test Suites/TIP/Test users authority to download files - Chrome - 20181217_08303
9......................................................................2/2(100%)
Test Suites/TIP/Display case list with success - Chrome - 20181217_083039.......
.......................................................................2/2(100%)
Test Suites/TIP/Create case with error - Chrome - 20181217_083039......2/2(100%)
Test Suites/TIP/Create case with success - Chrome - 20181217_083039....5/5(100%)
--------------------------------------------------------------------------------
ERROR: Job failed: command terminated with exit code 1

Here is my .gitignore:

.classpath
/Reports
.project
/bin/
/Libs/Temp*

.gitlab-ci.yml

variables:
DOCKER_DRIVER: overlay
DOCKER_HOST: tcp://localhost:1234
GIT_DEPTH: “5”

stages:

  • katalon_test

katalon.test:
tags:
- docker
when: always
image: myownimage/katalon:1.3
stage: katalon_test
script:
- echo “Starting Katalon Studio”
- report_dir=/root/report
- mkdir -p $report_dir
- $KATALON_BASE_ROOT_DIR/scripts/xvfb.sh start
- $KATALON_KATALON_INSTALL_DIR/katalon -runMode=console -reportFolder=$report_dir -projectPath="$CI_PROJECT_DIR/Katalon/Katalon.prj" -retry=0 -testSuitePath=“Test Suites/TIP/Create case with success” -executionProfile=“staging” -browserType=“Chrome”

Any suggestions?

EDIT: I am running under Windows 10 environment and the runner is executing under Linux environment using docker in docker.

Could you try again with a very simple Test Suite (it should contain a single Test Case)? It will help debugging easier.

Also, would the following GitLab CI config work for you?

@devalex88 Hi, I just tried the the CI config but it didn’t work for me since it couldn’t find the runner. However, I found that the problem lies in the Test Suite that uses keywords after executing Test Suites one by one. What should I do to see if the class path can be found?

EDIT: there are warnings shown on the Log Viewer in my local machine since I’m waiting an element through while-loop with FailureHandling.OPTIONAL:

while (!(WebUI.waitForElementPresent(findTestObject(‘Page_TIP/Case Detail/text_entity name’), 10, FailureHandling.OPTIONAL)) &&
(counter < 30)) {
counter++
WebUI.refresh()
}

Would warning messages cause job to fail?

Just wonder - how about WebUI.waitForElementPresent(findTestObject('Page_TIP/Case Detail/text_entity name'), 300, FailureHandling.OPTIONAL) instead of the while loop?

The website I am testing doesn’t use AJAX so the element won’t show up automatically unless I request the page again.

After the loop exits, did the element show up? Try adding some logging or verifyElementPresent statements.

I can’t tell from the gitlab-ci log but it did find the element after loop in my machine. From the ci log it seems that the test cases didn’t WAIT for the element at all:

--------------------------------------------------------------------------------
Test Suites/TIP/TIP Test Suite Collection - 20181218_052637..............0/2(0%)
--------------------------------------------------------------------------------
Test Suites/TIP/Test users authority to download files - Chrome - 20181218_05263
7........................................................................0/2(0%)
--------------------------------------------------------------------------------

Request sent successfully.
Copying report to folder /root/report/20181218_052637...

--------------------------------------------------------------------------------
Test Suites/TIP/TIP Test Suite Collection - 20181218_052637............2/2(100%)
--------------------------------------------------------------------------------
Test Suites/TIP/Test users authority to download files - Chrome - 20181218_05263
7......................................................................2/2(100%)
--------------------------------------------------------------------------------

ERROR: Job failed: exit code 1

I’m trying to fix this in the aspect of keywords path and running out of memory.

EDIT: the problem lies in the class path to my keyword class. Since I was sending a POST to the web api with file, the path included back-slash(’\’):

com.kms.katalon.core.exception.KatalonRuntimeException: java.io.FileNotFoundException: /Katalon\path\to\my\keywords\class (No such file or directory)

@devalex88 Great thanks for your help!