gpt4 book ai didi

java - 将 Katalon Studio 更新至版本 5.9.1 - ClassNotFoundException

转载 作者:行者123 更新时间:2023-11-30 05:51:44 26 4
gpt4 key购买 nike

将 Katalon Studio 更新到 5.9.1 后,在 Jenkins 中运行测试时,我们的自定义关键字类偶尔会出现 java.lang.ClassNotFoundException: cz.elektLabs.Keywords

奇怪的是,这种情况并不是每次都会发生,而且我们无法重现它。之前它在 5.7 中有效。

这是我们的自定义关键字类的开头:

package cz.elektLabs
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import org.jsoup.select.Elements
import org.openqa.selenium.By

import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.util.KeywordUtil
import com.kms.katalon.core.webui.driver.DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import groovy.json.JsonSlurper
import groovy.time.TimeCategory
import internal.GlobalVariable

class Keywords {
@Keyword
def boolean checkIfValidImage(String url) {
...
}
...
}

这是我们得到的错误:

2018-12-14 09:18:53.987 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - ? cz.elektLabs.Keywords
2018-12-14 09:18:53.988 ERROR c.k.katalon.core.main.TestCaseExecutor - ? cz.elektLabs.Keywords.openAndLogin() FAILED.
Reason:
java.lang.ClassNotFoundException: cz.elektLabs.Keywords
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:98)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:44)
at TestSystem.run(TestSystem:17)
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:321)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:312)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:291)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:283)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:222)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:129)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:112)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:81)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:149)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1544775530390.run(TempTestSuite1544775530390.groovy:36)

我们可以做些什么来解决这个问题吗?

编辑:我们将 Katalon Studio 更新到版本 5.10.1,但我们仍然时不时地收到 ClassNotFoundExceptionNoClassDefFoundError

最佳答案

请确保您已在计算机上安装Open JDK 1.8

关于java - 将 Katalon Studio 更新至版本 5.9.1 - ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53776207/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com