IDEA运行TestNG报错rg.testng.TestNGException: org.xml.sax.SAXParseException;
从eclipse复制的依赖注解,一运行测试脚本发现报错如下:
"F:\Program Files\Java\jdk1.7.0_17\bin\java" -ea -Didea.launcher.port=7533 "-Didea.launcher.bin.path=F:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1\bin" -Dfile.encoding=UTF-8 -classpath "F:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1\plugins\testng\lib\testng-plugin.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\charsets.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\deploy.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\javaws.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\jce.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\jfr.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\jfxrt.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\jsse.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\management-agent.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\plugin.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\resources.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\rt.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\access-bridge-64.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\dnsns.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\jaccess.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\localedata.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunec.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunjce_provider.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunmscapi.jar;F:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\zipfs.jar;E:\workespace\demotest\target\classes;E:\repository\org\testng\testng\6.9.10\testng-6.9.10.jar;E:\repository\com\beust\jcommander\1.48\jcommander-1.48.jar;E:\repository\org\beanshell\bsh\2.0b4\bsh-2.0b4.jar;E:\repository\selenium-server-standalone\selenium-server-standalone\2.53\selenium-server-standalone-2.53.jar;F:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1\plugins\testng\lib\testng.jar;F:\Program Files (x86)\JetBrains\IntelliJ IDEA 14.1\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.testng.RemoteTestNGStarter -port 65416 -usedefaultlisteners false -socket65417 -temp F:\temp\idea_testng4.tmp
org.testng.TestNGException: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 44; 值为 "none" 的属性 "parallel" 必须具有列表 "false methods tests classes instances " 中的值。
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:325)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:90)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177)
at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 44; 值为 "none" 的属性 "parallel" 必须具有列表 "false methods tests classes instances " 中的值。
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.validateDTDattribute(XMLDTDValidator.java:1392)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1311)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1917)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:742)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3065)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:881)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at org.testng.xml.XMLParser.parse(XMLParser.java:39)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
at org.testng.xml.Parser.parse(Parser.java:172)
at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:305)
... 9 more
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Process finished with exit code 0
解决方案:
原因为6.9.10版本的testng,开始验证xml中的元素;而idea默认的testng.xml模板中parallel设置为none,因此报错。
所以解决方法:
1. testng 使用6.9.9
或者
2. testng使用6.9.10, 在testng.xml中parallel设置为false
效果如下:
IDEA运行TestNG报错rg.testng.TestNGException: org.xml.sax.SAXParseException;的更多相关文章
- 在ios7真机上和iOS6模拟器上运行是好的,而在iOS6真机上运行却报错
在ios7真机上和iOS6模拟器上运行是好的,而在iOS6真机上运行却报错 解决方法: 或是都设置为yes.. Build Active Architecture Only的意思是只生成适应的指令集
- 运行yum报错Error: Cannot retrieve metalink for reposit
http://www.netpc.com.cn/593.html 运行yum报错Error: Cannot retrieve metalink for reposit 今天给Centos通过rpm - ...
- 转:运行yum报错Error: Cannot retrieve metalink for reposit
http://www.netpc.com.cn/593.html 运行yum报错Error: Cannot retrieve metalink for repository: epel. Please ...
- 新建SpringBoot项目运行页面报错Whitelabel Error Page This application has no explicit mapping for /error, so yo
新建SpringBoot项目运行页面报错Whitelabel Error Page This application has no explicit mapping for /error, so yo ...
- 安装了nodejs后在命令行运行npm报错
安装了nodejs后在命令行运行npm报错:Error: Cannot find module 'internal/util/types' 解决方法:删除目录“C:\Users\mengxiaobo\ ...
- manjaro运行virtualbox报错
manjaro运行virtualbox报错manjaro使用添加删除程序搜索virtualbox安装后运行报错, 安装过程有选择modules的过程(这里要选择匹配当前系统内核的版本),当时不了解是干 ...
- vs2010一运行就报错deven.exe assert failure 解决方法,卸载系统中.netFramework最新版本的(简体中文)
vs2010一运行就报错deven.exe assert failure 解决方法,卸载系统中.netFramework最新版本的(简体中文)
- homestead虚拟机,通过npm下载依赖包和解决运行gulp报错问题 yarn出错问题
homestead虚拟机,通过npm下载依赖包和解决运行gulp报错问题 yarn出错问题 1. 在虚拟器运行 npm 下载依赖组件时报错: npm ERR! EPROTO: protocol err ...
- Mac上PyCharm运行多进程报错的解决方案
Mac上PyCharm运行多进程报错的解决方案 运行时报错 may have been in progress in another thread when fork() was called. We ...
随机推荐
- “由于下列错误,Parallel port driver 服务启动失败”,注意了
最近在“事件查看器”中发现这么一个错误:“由于下列错误,Parallel port driver 服务启动失败”, 我到网上搜索了一下,发现很多网页上都说解决办法: 把HKEY_LOCAL_MACHI ...
- 使用Nginx反向代理和proxy_cache缓存搭建CDN服务器加快Web访问速度
碰到问题:移动用户访问web服务器www.osyunwei.com很慢解决办法:1.在移动机房放置一台nginx反向代理服务器2.通过域名DNS智能解析,所有移动用户访问www.osyunwei.co ...
- java基础基础总结----- 关键字、标识符、注释、常量和变量、运算符、语句、函数、数组(三)
Java语言基础组成:关键字.标识符.注释.常量和变量.运算符.语句.函数.数组 一.标识符 标识符是在程序中自定义的一些名称,由大小写字母[a-zA-Z],数字[0-9],下划线[ _ ],特殊字符 ...
- 获取天气预报API5_统计最容易生病时间段
sklearn实战-乳腺癌细胞数据挖掘(博客主亲自录制视频教程) https://study.163.com/course/introduction.htm?courseId=1005269003&a ...
- 直接用<img> 的src属性显示base64转码后的字符串成图片【原】
直接用<img> 的src属性显示base64转码后的字符串成图片 <img src="data:image/gif;base64,base64转码后的字符串" ...
- STM32Cube自学-1
为了方便调试,使用Keil5+Proteus.1.新建Proteus STM32项目,选择STMF103C6 2.新建STM32CubeMX项目,选择同型号CPU,选择UART1,Asynchrono ...
- VS新建项目工具箱图标丢失问题
(1)在电脑里搜索*.tbd文件(2)建一个项目,把需要的工具箱图标加载上,退出 VS. (3)复制一份toolbox.tbd,重命名为toolbox_reset.tbd 然后以后新建项目就可以了.这 ...
- 如何理解<base href="<%=basePath%>"
原文链接http://316325524.blog.163.com/blog/static/6652052320111118111620897/ "base href " 今天在写 ...
- Python写日志
import logging import ResultFolder logger = logging.getLogger() logger.setLevel(logging.DEBUG) def C ...
- loadrunner函数解密之web_reg_find
loadrunner工具的使用,最关键的在于3个地方: A:脚本的编写 B:场景设计 C:性能测试结果分析 其中难度比较大的第一步是:编写脚本,有很多人对于loadrunner里面的各种函数使用的并不 ...