Katalon project get error on Linux server executing


#1

Hi, I get error when execute our project on the Linux server with Katalon latest version 6.1.1, but same project works correct for me on the local machine with Win10

Blockquote


Test Suites/TestRail_automation - Firefox - 20190411_165812…0/1(0%)

2019-04-11 16:59:28.362 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2019-04-11 16:59:28.368 INFO c.k.katalon.core.main.TestCaseExecutor - CALL Test Cases/TestRail_Update_Run_With_Results
2019-04-11 16:59:28.827 DEBUG t.TestRail_Update_Run_With_Results - 1: response = synctestrail.Testrail.get_tests(G_testrail_run_id)
2019-04-11 16:59:28.829 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - Б²▄ synctestrail.Testrail
2019-04-11 16:59:28.852 ERROR c.k.katalon.core.main.TestCaseExecutor - Б²▄ response = synctestrail.Testrail.get_tests(G_testrail_run_id) FAILED.
Reason:
java.lang.ClassNotFoundException: synctestrail.Testrail
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:98)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:44)
at TestRail_Update_Run_With_Results.run(TestRail_Update_Run_With_Results:60)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:331)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:322)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:301)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:293)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:227)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:66)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:334)
at NewTestListener.afterTestSuite(NewTestListener.groovy:51)
at NewTestListener.invokeMethod(NewTestListener.groovy)
at com.kms.katalon.core.context.internal.TestHooker.invokeMethod(TestHooker.java:132)
at com.kms.katalon.core.context.internal.TestHooker.lambda$5(TestHooker.java:116)
at com.kms.katalon.core.context.internal.TestHooker.invokeContextMethods(TestHooker.java:115)
at com.kms.katalon.core.context.internal.TestListenerCollector.lambda$3(TestListenerCollector.java:60)
at com.kms.katalon.core.context.internal.TestListenerCollector.handleListenerEvent(TestListenerCollector.java:57)
at com.kms.katalon.core.context.internal.ExecutionEventManager.publicEvent(ExecutionEventManager.java:36)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:89)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1555001892731.run(TempTestSuite1555001892731.groovy:35)

2019-04-11 16:59:28.861 ERROR c.k.katalon.core.main.TestCaseExecutor - Б²▄ Test Cases/TestRail_Update_Run_With_Results FAILED.
Reason:
java.lang.ClassNotFoundException: synctestrail.Testrail
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:98)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:44)
at TestRail_Update_Run_With_Results.run(TestRail_Update_Run_With_Results:60)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:331)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:322)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:301)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:293)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:227)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:66)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:334)
at NewTestListener.afterTestSuite(NewTestListener.groovy:51)
at NewTestListener.invokeMethod(NewTestListener.groovy)
at com.kms.katalon.core.context.internal.TestHooker.invokeMethod(TestHooker.java:132)
at com.kms.katalon.core.context.internal.TestHooker.lambda$5(TestHooker.java:116)
at com.kms.katalon.core.context.internal.TestHooker.invokeContextMethods(TestHooker.java:115)
at com.kms.katalon.core.context.internal.TestListenerCollector.lambda$3(TestListenerCollector.java:60)
at com.kms.katalon.core.context.internal.TestListenerCollector.handleListenerEvent(TestListenerCollector.java:57)
at com.kms.katalon.core.context.internal.ExecutionEventManager.publicEvent(ExecutionEventManager.java:36)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:89)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1555001892731.run(TempTestSuite1555001892731.groovy:35)

2019-04-11 16:59:28.877 INFO c.k.katalon.core.main.TestCaseExecutor - END CALL Test Cases/TestRail_Update_Run_With_Results
2019-04-11 16:59:28.877 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2019-04-11 16:59:28.886 ERROR c.k.k.core.keyword.internal.KeywordMain - Б²▄ Unable to call Test Case ‘Test Cases/TestRail_Update_Run_With_Results’ (Root cause: com.kms.katalon.core.exception.StepErrorException: Call Test Case ‘Test Cases/TestRail_Update_Run_With_Results’ failed because of error(s)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:66)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:66)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:44)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:334)
at NewTestListener.afterTestSuite(NewTestListener.groovy:51)
at NewTestListener.invokeMethod(NewTestListener.groovy)
at com.kms.katalon.core.context.internal.TestHooker.invokeMethod(TestHooker.java:132)
at com.kms.katalon.core.context.internal.TestHooker.lambda$5(TestHooker.java:116)
at com.kms.katalon.core.context.internal.TestHooker.invokeContextMethods(TestHooker.java:115)
at com.kms.katalon.core.context.internal.TestListenerCollector.lambda$3(TestListenerCollector.java:60)
at com.kms.katalon.core.context.internal.TestListenerCollector.handleListenerEvent(TestListenerCollector.java:57)
at com.kms.katalon.core.context.internal.ExecutionEventManager.publicEvent(ExecutionEventManager.java:36)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:89)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1555001892731.run(TempTestSuite1555001892731.groovy:35)
Caused by: java.lang.ClassNotFoundException: synctestrail.Testrail
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:98)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:44)
at TestRail_Update_Run_With_Results.run(TestRail_Update_Run_With_Results:60)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:331)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:322)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:301)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:293)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:227)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:59)
… 18 more
)
2019-04-11 16:59:28.958 INFO c.k.katalon.core.main.TestSuiteExecutor - --------------------
2019-04-11 16:59:28.966 INFO c.k.katalon.core.main.TestSuiteExecutor - END Test Suites/TestRail_automation
2019-04-11 16:59:28.967 INFO c.k.katalon.core.main.TestSuiteExecutor - ====================
Copying report to folder /var/katalonstudio/report…


Test Suites/TestRail_automation - Firefox - 20190411_165812…1/1(100%)

Blockquote


#2

@vadim.po were this class created by yourself, or provided in a JAR library?


#3

this class was created by myself


#4

Could you please share the class implementation?


#5

yes, sure

package synctestrail

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.checkpoint.Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testcase.TestCase
import com.kms.katalon.core.testcase.TestCaseFactory
import com.kms.katalon.core.testdata.TestData
import com.kms.katalon.core.testdata.TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords

import internal.GlobalVariable

import org.junit.After

import MobileBuiltInKeywords as Mobile
import WSBuiltInKeywords as WS
import WebUiBuiltInKeywords as WebUI

import com.thoughtworks.selenium.webdriven.WebDriverBackedSelenium as WebDriverBackedSelenium

import groovy.json.JsonSlurper as JsonSlurper
import com.kms.katalon.core.testobject.TestObjectProperty as TestObjectProperty
import com.kms.katalon.core.testobject.ResponseObject as ResponseObject
import com.kms.katalon.core.testobject.ConditionType
import com.kms.katalon.core.testobject.RequestObject as RequestObject
import com.kms.katalon.core.testobject.impl.HttpTextBodyContent

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

public class Testrail {
//Makes a GET request to TestRail to get all the test case IDs from the selected TestRail run.
@Keyword
def get_tests(String id) {
def slurper = new JsonSlurper()
RequestObject ro = new RequestObject(‘Get TestRail tests’)
ro.setRestRequestMethod(‘GET’)
ro.setRestUrl(‘https://mydomain.testrail.io/index.php?/api/v2/get_tests/’ + id)

  def httpheader = new ArrayList<TestObjectProperty>()
  httpheader.add(new TestObjectProperty(
  		'Content-Type', ConditionType.EQUALS, 'application/json'))

  httpheader.add(new TestObjectProperty(
  		'Authorization', ConditionType.EQUALS,
  		'Basic AAA0b21hdGlvbkBtZW5zY2guaW86UmFzd2QxBBB='))

  ro.setHttpHeaderProperties(httpheader)
  ro.setBodyContent(
  		new HttpTextBodyContent('', 'UTF-8', 'application/json'))

  def response = WS.sendRequest(ro)
  return slurper.parseText(response.getResponseText())

}

@Keyword
def update_run(String id, String array) {
def slurper = new JsonSlurper()
def ro = new RequestObject(‘Update TestRail test run’)
ro.setRestRequestMethod(‘POST’)
ro.setRestUrl(‘https://mydomain.testrail.io/index.php?/api/v2/update_run/’ + id)

  def httpheader = new ArrayList<TestObjectProperty>()
  httpheader.add(new TestObjectProperty(
  		'Content-Type', ConditionType.EQUALS, 'application/json'))
  httpheader.add(new TestObjectProperty(
  		'Authorization', ConditionType.EQUALS, 'Basic AAA0b21hdGlvbkBtZW5zY2guaW86UmFzd2QxBBB='))
  ro.setHttpHeaderProperties(httpheader)


  def body ='{"include_all": false,"case_ids": ' + array + "}"
  WebUI.comment('body = ' + body)
  ro.setBodyContent(
  		new HttpTextBodyContent(body, 'UTF-8', 'application/json'))
  def response = WS.sendRequest(ro)
  return slurper.parseText(response.getResponseText())

}

@Keyword
def add_results(String id, String request) {
def slurper = new JsonSlurper()
RequestObject ro = new RequestObject(‘Add TestRail results’)
ro.setRestRequestMethod(‘POST’)
ro.setRestUrl(‘https://mydomain.testrail.io/index.php?/api/v2/add_results_for_cases/’ + id)

  def httpheader = new ArrayList<TestObjectProperty>()
  httpheader.add(new TestObjectProperty(
  		'Content-Type', ConditionType.EQUALS, 'application/json'))
  httpheader.add(new TestObjectProperty(
  		'Authorization', ConditionType.EQUALS,
  		'Basic AAA0b21hdGlvbkBtZW5zY2guaW86UmFzd2QxBBB='))
  ro.setHttpHeaderProperties(httpheader)


  WebUI.comment('body = ' + request)
  ro.setBodyContent(new HttpTextBodyContent(
  		request, 'UTF-8', 'application/json'))


  def response = WS.sendRequest(ro)
  def response_array = slurper.parseText(response.getResponseText())
  return slurper.parseText(response.getResponseText())

}
}