【发布时间】:2023-02-08 00:11:52
【问题描述】:
我需要在 Jmeter 中运行我的 Selenium 脚本。我想使用 Junit 请求。为此,我需要从我的测试文件中创建一个 .jar 文件。但我不知道如何。 这是我的测试课: enter image description here
当我尝试使用以下方法制作 .jar 时:文件 -> 项目结构 -> 工件 -> + -> 来自具有依赖项的模块的 Jar -> 这里我试图选择类: enter image description here 但这是不可能的,因为我的登录类是“单元测试类”。
是否有可能以某种方式从单元测试类制作 .jar 文件?我的 pom.xml 中的依赖关系会被保留吗?
我试图在主类下创建它,但 JUnit 注释存在问题。 enter image description here
不幸的是,我无法通过这些技巧实现这一目标:( https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html
【问题讨论】:
-
如果您使用提供的链接中的简单方法,您的测试 jar 将在您执行 maven build (mvn install) 时自动生成。您不必显式生成 jar
标签: java selenium junit jmeter