zoukankan      html  css  js  c++  java
  • testng-result中文乱码问题

    背景

    执行完用例查看报告,发现testng-result.xml文件中关于中文的都是乱码

    解决方法

    eclipse已设置了utf-8去编译,所以直接运行run as testng ,在console栏输出中文是没有问题的

    通过mvn去执行的时候用的是maven-surefire-plugin插件,所以需要修改这里新增

    <argLine>-Dfile.encoding=UTF-8</argLine> 
    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19.1</version>
                    <configuration>
                        <suiteXmlFiles>
                            <suiteXmlFile>testng.xml</suiteXmlFile>
                        </suiteXmlFiles>
                        <testFailureIgnore>false</testFailureIgnore>
                        <argLine>
                            -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar -Dcucumber.options="--plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter"
                        </argLine>
                        <argLine>-Dfile.encoding=UTF-8</argLine>   
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjweaver</artifactId>
                            <version>${aspectj.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
  • 相关阅读:
    TensorFlow学习笔记--CIFAR-10 图像识别
    第二章--第二节:注释
    webbrowser
    RichViewEdit
    RichEdit
    TreeView
    RichView
    ListView
    DesktopLoader服务程序
    Delphi实现程序只运行一次并激活已打开的程序
  • 原文地址:https://www.cnblogs.com/jwentest/p/7073210.html
Copyright © 2011-2022 走看看