gpt4 book ai didi

java - HP 服务测试 - 调用 Java 类服务 - 有类路径问题

转载 作者:行者123 更新时间:2023-11-28 21:34:08 24 4
gpt4 key购买 nike

我目前正在使用 HP Service Test 11.10 来测试对 Web 界面的调用,但作为此测试的一部分,我正在向 Oracle 数据库添加一些数据,默认情况下 HPST 不支持。 HPST 确实支持调用 java 类,因此我尝试调用 .JAR 文件中的 Java 类。我已将此 .JAR 文件放在我的测试解决方案所在的目录中。当我向 Call Java Class 添加一个步骤时,我可以选择并运行该文件,但我遇到了一个问题,我无法将我的测试解决方案移动到另一个目录,而不会在我运行测试时出现 java.lang.NoClassDefFoundError .

据我所知,当我添加 .JAR 时它试图调用特定路径(即类似于 c:\temp{test directory},即使我可能已将其移动到 c:\users {用户名}\工作区{测试目录})。我该如何更改它,以便它始终与此 .JAR 文件的测试解决方案位于同一目录中?....

最佳答案

来自惠普软件解决方案社区论坛:

Hello, You are right, the path of the .jar file is indeed preserved within the test as it is translated to code. This path cannot be modified, and there's no way to add jar paths relatively to the test path.

But still, one workaround I can think of is to include this jar in what we call InternalJavaClasspath:

You can define a new path to that jar of yours within InternalJavaClasspath.dat located under {hp_service_test_installation_folder}\dat And then you must put this jar in a subfolder under the installation folder.

The common location is: bin/java - you can create a folder here called MySpecialJars and the respective line in the dat file will be: bin/java/MySpecialJars/MySpecialJar01.jar

关于java - HP 服务测试 - 调用 Java 类服务 - 有类路径问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6738416/

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