获取java.lang.reflect.InvocationTargetException;嵌套异常是java.lang.reflect.InvocationTargetException:null

时间:2016-09-07 12:32:36

标签: java eclipse maven selenium

Maven无法识别angular.module('MyApp',['ngMaterial', 'ngMessages', 'material.svgAssetsCache', 'ngDialog']) .controller('AppCtrl', function($scope) { $scope.maintenanceMessage = { description: { requiredMessage: "This is required", maxLengthMessage: "Max length is 40" } }; $scope.resetForm = function () { $scope.newMaintenanceMessage = {}; $scope.maintenanceMessageForm.$setUntouched(); $scope.maintenanceMessageForm.$setPristine(); }; }); 文件。获得如下异常:

  

引起:org.apache.maven.surefire.testset.TestSetFailedException:
  套件文件
  d:\硒工作区\ WEB-自动化的\ src \主\资源\ RegressionSuite.xml
  不是有效的文件

的pom.xml

testng.xml

Regression.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.automation</groupId>
  <artifactId>web-automation</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>mycompany.web.automation project</name>
  <description>mycompany.web.automation project</description>

  <dependencies>
     <dependency>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.53.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.9.10</version>
</dependency>
 </dependencies>
 <properties>
       <suiteXmlFile>src/main/resources/RegressionSuite.xml</suiteXmlFile>
       <skipTests>false</skipTests>
 </properties>

<build>
    <plugins>
          <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <version>2.12.4</version>
                 <configuration>
                            <suiteXmlFiles>
                                   <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
                            </suiteXmlFiles>
                 </configuration>
          </plugin>
    </plugins>
</build>

</project>

输出

  

T E S T S

           

org.apache.maven.surefire.util.SurefireReflectionException:java.lang.reflect.InvocationTargetException;嵌套异常是   java.lang.reflect.InvocationTargetException:null       java.lang.reflect.InvocationTargetException         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         at java.lang.reflect.Method.invoke(Method.java:498)         at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)         在org.apache.maven.surefire.booter.ProviderFactory $ ProviderProxy.invoke(ProviderFactory.java:165)         在org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)         在org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)         在org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)       引起:org.apache.maven.surefire.testset.TestSetFailedException:Suite文件   d:\硒工作区\ WEB-自动化的\ src \主\资源\ RegressionSuite.xml   不是有效的文件         在org.apache.maven.surefire.testng.TestNGXmlTestSuite.locateTestSets(TestNGXmlTestSuite.java:124)         在org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:89)     ... 9更多

     

结果:

     

测试运行:0,失败:0,错误:0,跳过:0

0 个答案:

没有答案