- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
According to this question ,我创建了一个批处理文件并为其创建了计划任务。但是,它没有在预定时间运行。我尝试执行注释 testng.xml 行的脚本,并在 bin 和 lib 的路径中看到一个空格。
这可能是原因吗?有什么想法请提出来。
这是我的脚本:
set ProjectPath=C:\Users\workspace\RestAssured
echo %ProjectPath%
set classpath=%ProjectPath%\bin;%ProjectPath%\Lib\*
echo %classpath%
java org.testng.TestNG %ProjectPath%\testng.xml
系统抛出以下 classNotFoundException :
Error: Could not find or load main class org.testng.TestNG
Caused by: java.lang.ClassNotFoundException: org.testng.TestNG
这是错误日志:
C:\Users\eclipse-workspace\RestAssured>set classpath=C:\Users\eclipse-workspace\RestAssured \bin;C:\Users\eclipse-workspace\RestAssured \lib*
C:\Users\eclipse-workspace\RestAssured>echo C:\Users\eclipse-workspace\RestAssured \bin;C:\Users\eclipse-workspace\RestAssured \lib*
C:\Users\eclipse-workspace\RestAssured \bin;C:\Users\eclipse-workspace\RestAssured \lib*
C:\Users\eclipse-workspace\RestAssured>java org.testng.TestNG >
C:\Users\eclipse-workspace\RestAssured \testng.xml
Error: Could not find or load main class org.testng.TestNG
Caused by: java.lang.ClassNotFoundException: org.testng.TestNG
Build step 'Execute Windows batch command' marked build as failure
这是 TestNG 的详细信息:
> ...
... TestNG 6.9.6 by C??dric Beust (cedric@beust.com)
...
[TestRunner] Running the tests in 'Rep' with parallel mode:tests
[RunInfo] Adding method selector: org.testng.internal.XmlMethodSelector@3857f613 priority: 10
[TestClass] Creating TestClass for [ClassImpl class=com.root.com.RepZmap]
[TestClass] Adding method RepZmap.ZmapTest()[pri:0, instance:null] on TestClass class com.root.com.RepZmap
[XmlMethodSelector] Including method com.root.com.sendEmailReport()
[XmlMethodSelector] Including method com.root.com.startTest()
[XmlMethodSelector] Including method com.root.com.endReport()
[XmlMethodSelector] Including method com.root.com.initializeValues()
[XmlMethodSelector] Including method com.root.com.reportHeader()
[XmlMethodSelector] Including method com.root.com.getResult()
[TestClass] Creating TestClass for [ClassImpl class=com.root.com.RepMir112]
[TestClass] Adding method RepMir112.MirTest()[pri:0, instance:null] on TestClass class com.root.com.RepMir112
[TestClass] Creating TestClass for [ClassImpl class=com.root.com.RepMir113]
[TestClass] Adding method RepMir113.Mir113Test(java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:null] on TestClass class com.root.com.RepMir113
[XmlMethodSelector] Including method com.root.com.ZmapTest()
[XmlMethodSelector] Including method com.root.com.MirTest()
[XmlMethodSelector] Including method com.root.com.Mir113Test()
[TestNG] Running:
C:\Users\mhuntik\eclipse-workspace\RestAssured\testng.xml
[SuiteRunner] Created 1 TestRunners
[ThreadUtil] Starting executor timeOut:2147483647ms workers:1 threadPoolSize:5
[[SuiteWorker]] Running XML Test 'Rep' in Parallel
[TestRunner] Running test Rep on 3 classes, included groups:[] excluded groups:[]
===== Test class
com.root.com.RepZmap
@BeforeClass RepZmap.initializeValues()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
@BeforeMethod RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
@Test RepZmap.ZmapTest()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
@AfterMethod RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
======
===== Test class
com.root.com.RepMir112
@BeforeClass RepMir112.initializeValues()[pri:0, instance:com.root.com.RepMir112@6631f5ca]
@BeforeMethod RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepMir112@6631f5ca]
@Test RepMir112.MirTest()[pri:0, instance:com.root.com.RepMir112@6631f5ca]
@AfterMethod RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepMir112@6631f5ca]
======
===== Test class
com.root.com.RepMir113
@BeforeClass RepMir113.initializeValues()[pri:0, instance:com.root.com.RepMir113@5ace1ed4]
@BeforeMethod RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepMir113@5ace1ed4]
@Test RepMir113.Mir113Test(java.lang.String, java.lang.String, java.lang.String)[pri:0, instance:com.root.com.RepMir113@5ace1ed4]
@AfterMethod RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepMir113@5ace1ed4]
======
[Invoker 1303063064] Keeping method RepUtils.startTest()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] for class null
[Invoker 1303063064] Invoking @BeforeTest RepUtils.startTest()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
[Invoker 1303063064] Keeping method RepZmap.initializeValues()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] for class [TestClass name=class com.root.com.RepZmap]
[Invoker 1303063064] Invoking @BeforeClass RepZmap.initializeValues()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
[Invoker 1303063064] Keeping method RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] for class [TestClass name=class com.root.com.RepZmap]
[Invoker 1303063064] Keeping method RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] for class [TestClass name=class com.root.com.RepZmap]
[Invoker 1303063064] Keeping method RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] for class [TestClass name=class com.root.com.RepZmap]
[Invoker 1303063064] Invoking @BeforeMethod RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
[Invoker 1303063064] Invoking com.root.com.RepZmap.ZmapTest
--------- Sending IPs To Receiver --------------------
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.poi.openxml4j.util.ZipSecureFile$1 (file:/C:/Users/mhuntik/eclipse-workspace/RestAssured/lib/fillo-1.18.jar) to field java.io.FilterInputStream.in
WARNING: Please consider reporting this to the maintainers of org.apache.poi.openxml4j.util.ZipSecureFile$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[Invoker 1303063064] Keeping method RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] for class [TestClass name=class com.root.com.RepZmap]
[Invoker 1303063064] Invoking @AfterMethod RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
log4j:WARN No appenders could be found for logger (freemarker.cache).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
[Invoker 1303063064] Keeping method RepMir112.initializeValues()[pri:0, instance:com.root.com.RepMir112@6631f5ca] for class [TestClass name=class com.root.com.RepMir112]
[Invoker 1303063064] Invoking @BeforeClass RepMir112.initializeValues()[pri:0, instance:com.root.com.RepMir112@6631f5ca]
[Invoker 1303063064] Keeping method RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepMir112@6631f5ca] for class [TestClass name=class com.root.com.RepMir112]
[Invoker 1303063064] Keeping method RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepMir112@6631f5ca] for class [TestClass name=class com.root.com.RepMir112]
[Invoker 1303063064] Keeping method RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepMir112@6631f5ca] for class [TestClass name=class com.root.com.RepMir112]
[Invoker 1303063064] Invoking @BeforeMethod RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepMir112@6631f5ca]
[Invoker 1303063064] Invoking com.root.com.RepMir112.MirTest
--------- Sending IPs To Receiver --------------------
[Invoker 1303063064] Keeping method RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepMir112@6631f5ca] for class [TestClass name=class com.root.com.RepMir112]
[Invoker 1303063064] Invoking @AfterMethod RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepMir112@6631f5ca]
[Invoker 1303063064] Keeping method RepMir113.initializeValues()[pri:0, instance:com.root.com.RepMir113@5ace1ed4] for class [TestClass name=class com.root.com.RepMir113]
[Invoker 1303063064] Invoking @BeforeClass RepMir113.initializeValues()[pri:0, instance:com.root.com.RepMir113@5ace1ed4]
[Invoker 1303063064] Keeping method RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepMir113@5ace1ed4] for class [TestClass name=class com.root.com.RepMir113]
[Invoker 1303063064] Keeping method RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepMir113@5ace1ed4] for class [TestClass name=class com.root.com.RepMir113]
[Invoker 1303063064] Keeping method RepUtils.endReport()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] for class null
[Invoker 1303063064] Invoking @AfterTest RepUtils.endReport()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
===== Invoked methods
RepUtils.startTest()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] 1607792885
RepZmap.initializeValues()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] 1607792885
RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]public void com.root.com.RepZmap.ZmapTest() throws java.lang.Throwable 1607792885
RepZmap.ZmapTest()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] 1607792885
RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepZmap@5fd4f8f5][TestResult name=ZmapTest status=FAILURE method=RepZmap.ZmapTest()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] output={null}] 1607792885
RepMir112.initializeValues()[pri:0, instance:com.root.com.RepMir112@6631f5ca] 1714550218
RepUtils.reportHeader(java.lang.reflect.Method)[pri:0, instance:com.root.com.RepMir112@6631f5ca]public void com.root.com.RepMir112.MirTest() throws java.lang.Throwable 1714550218
RepMir112.MirTest()[pri:0, instance:com.root.com.RepMir112@6631f5ca] 1714550218
RepUtils.getResult(org.testng.ITestResult)[pri:0, instance:com.root.com.RepMir112@6631f5ca][TestResult name=MirTest status=FAILURE method=RepMir112.MirTest()[pri:0, instance:com.root.com.RepMir112@6631f5ca] output={null}] 1714550218
RepMir113.initializeValues()[pri:0, instance:com.root.com.RepMir113@5ace1ed4] 1523457748
RepUtils.endReport()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] 1607792885
=====
Creating C:\Users\mhuntik\eclipse-workspace\RestAssured\test-output\Repute\Rep.html
Creating C:\Users\mhuntik\eclipse-workspace\RestAssured\test-output\Repute\Rep.xml
FAILED: ZmapTest
java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
at io.restassured.config.EncoderConfig.<init>(EncoderConfig.java:61)
at io.restassured.config.RestAssuredConfig.<init>(RestAssuredConfig.java:41)
at io.restassured.RestAssured.<clinit>(RestAssured.java:420)
at com.root.com.RepZmap.ZmapTest(RepZmap.java:44)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:773)
at org.testng.TestRunner.run(TestRunner.java:623)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:391)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
FAILED: MirTest
java.lang.NoClassDefFoundError: Could not initialize class io.restassured.RestAssured
at com.root.com.RepMir112.MirTest(RepMir112.java:44)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:821)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1131)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:773)
at org.testng.TestRunner.run(TestRunner.java:623)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:391)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
SKIPPED: Mir113Test
java.lang.RuntimeException: java.lang.NoClassDefFoundError: jxl/Workbook
at org.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:162)
at org.testng.internal.Parameters.handleParameters(Parameters.java:430)
at org.testng.internal.Invoker.handleParameters(Invoker.java:1276)
at org.testng.internal.Invoker.createParameters(Invoker.java:992)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1082)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:773)
at org.testng.TestRunner.run(TestRunner.java:623)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:39)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:391)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: jxl/Workbook
at com.root.com.RepMir113.getExcelData(RepMir113.java:36)
at com.root.com.RepMir113.createSourceIPs(RepMir113.java:57)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:136)
... 16 more
Caused by: java.lang.ClassNotFoundException: jxl.Workbook
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
... 24 more
===============================================
Rep
Tests run: 3, Failures: 2, Skips: 1
===============================================
[Invoker 2014461570] Keeping method RepUtils.sendEmailReport()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5] for class null
[Invoker 2014461570] Invoking @AfterSuite RepUtils.sendEmailReport()[pri:0, instance:com.root.com.RepZmap@5fd4f8f5]
Mail sent successfully...
===============================================
Repute
Total tests run: 3, Failures: 2, Skips: 1
===============================================
最佳答案
你真的有名为“Lib”的目录吗?我期望“lib”在那里,因为 Windows 是区分大小写的操作系统。
关于java - testng.xml 的批处理文件未按计划运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52193878/
我正在尝试制作一个基于文本的批处理游戏。但是我刚开始写我以前从未遇到过的问题时遇到了一个问题。 :menu :: the game menu - opens when the game starts
我正在构建一个社交媒体应用程序,用户需要发布一些内容,然后将发布的内容传播给他/她的 4 个圈子内的所有成员。这意味着查询进入循环。它就像一个家谱。逻辑工作得很好。但现在,当每个圈子中的成员数量不断增
1. DECLARE TYPE ref_cursor_type IS ref CURSOR; v_mycursor ref_cursor_type;
我想在这里做的是循环直到按下“x”。我知道 CHOICE 带有 /T 选项。 但是 CHOICE 对我要播放的动画的超时时间太长。这是一个例子: @echo off cls set frame=2 :
我已经寻找解决方案,但我仍然遇到问题。我有两个文件: File1.txt 1111 2222 3333 File2.txt 1111 2222 3333 4444 我想要一个只有差异的输
我正在做一个批处理脚本,必须检查计算机上是否安装了一些程序。为此,我执行 programName --version我将输出存储在一个变量中。问题是当我尝试与正则表达式进行比较时(只知道该程序是否存在
我知道如何从同一个批处理文件中的函数返回值,但我发现从不同的批处理文件返回值时存在一些问题。下面是一个例子: 文件 1.cmd SETLOCAL ENABLEEXTENSIONS SETLOCAL E
我相信这个问题的答案应该很简单。我从一个地方获取目录列表并将它们存储到文本文档中。然后我读取文本文档名称并将它们存储到一个数组中。在此过程结束时,我希望删除数组中的所有条目。 我想这样做的原因是因为我
我家有两个摄像头,几乎每天都在创建图像。他们将它们保存到我的FTP服务器(Fritz.Box\Nas驱动器)。 文件夹结构如下: +-2016-08-24 +-+Subfolder +----+Ano
在Windows Batch中执行此操作。我有一个名称列表,并要求用户输入其名称。 我想检查该名称是否已经存在于列表中,如果存在,则直接进入goto,否则它将名称添加到列表中。 @echo off s
我正在编写一个批处理文件,我想运行一个 for 循环,将它的第一个值设置为一个变量。我只需要命令的第一个值,但我找不到另一种方法来做到这一点。我设置它的方式是使用一个 for 循环,然后是一个 do
我需要创建一个批处理文件,使用tracert命令跟踪一些IP,并将跟踪写入txt文件。我希望它很快,所以我想为每个跟踪启动一个新命令,以使所有跟踪请求立即启动。 这是我的 ping.bat: @ech
我想在批处理文件中使用PowerShell命令发送电子邮件。为此,我实现了一个名为 sendMail 的函数。我这样称呼它: setlocal enabledelayedexpansion call:
想要使用 java 执行 selenium 脚本/批处理脚本。根据输入参数调用脚本/批处理脚本。 了解如何使用 java 代码运行脚本/批处理。 请帮帮我。 最佳答案 要运行 java 项目中文件中包
我正在练习 JDBC 批处理并遇到错误: 错误1:不支持的功能错误2:执行不能为空或为null Property files include: itemsdao.updateBookName = Up
我从 json 文件中得到了以下字符串: 39468856, 现在,我想用这些数字进行计算..因此,我必须删除末尾的 , 。 此时我使用以下代码: for /f "skip=24 tokens=2"
我有一堆 SQL 查询作为文件存储在磁盘上。 它们都是纯 SELECT 查询,换句话说,它们只做读操作。 我正在连接到 Oracle 11g 数据库,我想测量所有这些查询的大致执行时间。有没有办法以编
我正在使用 java 来存储属性文件的目录路径。 然后在 bat 文件中我使用属性作为变量。 问题出在 Java 中,文件路径存储为 SOME_VAR=D\:\\Madhan\\Program Fil
我想用“%”替换字符串中的“mod”:set string=%string:mod=x%我应该输入什么作为“x”? 最佳答案 您可以通过启用延迟扩展来做到这一点,以便您可以使用 !作为分隔符。然后,将
在我目前正在处理的批处理文件中,我遇到了一个小问题。我有一个名为 Dimensions(number from 1-5, defined in a for /l loop).txt 的文件,其中包含
我是一名优秀的程序员,十分优秀!