将Firefox浏览器升级到57.0后,无法使用Selenium框架(pom.xml)

时间:2017-12-04 07:32:21

标签: maven selenium-webdriver testng

enter image description here

将Firefox浏览器升级到57.0后,我无法使用Selenium框架(pom.xml)。硒 - 氧1

以下是错误:

log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for 
more info.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to 
host 
127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
file\extensions\fxdriver@googlecode.com

注意:我可以使用.xml运行我的脚本,但无法与pom.xml

运行相同的脚本

参考截图

以下是我的POM课程:

  <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>org.justdial</groupId>
    <artifactId>WebApplicationFramework</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Evangelist</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.53.1</version>
        </dependency>
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>4.1.2</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>
            <type>maven-plugin</type>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>[3.9,)</version>
        </dependency>
<dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>[3.9,)</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
            <version>[3.9,)</version>
        </dependency>

        <dependency><!-- This is required for Selenium -->
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>

        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.6.0</version>
        </dependency>

        <dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>22.0</version>
</dependency>

        <dependency><!--Might have to add mysql-connector-java-5.1.13-bin -->
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.35</version>
        </dependency>

        <dependency>
            <groupId>justdial</groupId>
            <artifactId>web-automation</artifactId>
            <version>1.0.0</version>
            <scope>system</scope>
            <systemPath>C:/Users/vaibhavsi/.m2/repository/justdial/web-
     automation/1.0.0/web-automation-1.0.0.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>2.2.1</version>
        </dependency>


    </dependencies>

    <!-- <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> 
        <artifactId>maven-surefire-plugin</artifactId> <configuration> <groups>${group.type}</groups> 
        <properties> <property> <name>listener</name> <value>com.justdial.listener.CustomReporter,com.justdial.listener.CustomListener,com.justdial.listener.TestsListenerAdapter</value> 
        </property> </properties> </configuration> </plugin> </plugins> </build> -->

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>

                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>Intlautomation.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <systemPropertyVariables>
                        <!-- Paramater execution environment "mvn test -
                             DsuiteFile=smoke.xml 
                            -Denvironment=sandbox" -->
                        <environment>Staging</environment>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
                <configuration>
                    <filesets>
                        <fileset>

    <directory>src/test/java/org/justdial/log/Screenshots</directory>
                            <includes>
                                <include>**/*.*</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <fork>true</fork>
                    <executable>C:/Program 
    Files/Java/jdk1.8.0_144/bin/javac.exe</executable>
                    <compilerVersion>1.8</compilerVersion>
                    <!-- <source>1.7</source> <target>1.7</target> -->
                </configuration>
            </plugin>

        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>

                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.5</version>
                </plugin>

             </plugins>
    </reporting>

</project>

添加脚本:

package com.justdial.International;

import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.io.IOException;
import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;

import org.justdial.appLib.ApplicationLibrary;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.justdial.base.TestBase;
import com.justdial.frame.Email;
import com.justdial.frame.ExcelReadWrite;
import com.justdial.urbanclap.UrbanClap;

public class IntlAutomation extends ApplicationLibrary{
    private static final String String = null;
    ExcelReadWrite exclwrdt=  new ExcelReadWrite();
    Email email = new Email();

    // Create excel sheet
    public IntlAutomation (){
        this.exclwrdt = exclwrdt;

    }
    @Test (priority = 1)
    public void USAutomation() throws InterruptedException, IOException  {
         WebDriver driver = null;
        exclwrdt.createFile();
        TestBase api = new TestBase();
        US_Home us = new US_Home(driver, exclwrdt);

//--------------------------------------------------------------------------------------------  
    exclwrdt.createWorkSheet("Web_US_Home", 0);

/*  us.Proxy_Server("https://us.justdial.com/");
    exclwrdt.writeDataInBold("Proxy Server", "");*/

    //us.closeDriver();
    //exclwrdt.writeDataInBold("Proxy Server closed", "");

    us.jdpagelaunch("https://us.justdial.com/");
    exclwrdt.writeDataInBold("New York City", "");


/*  exclwrdt.writeDataInBold("Restaurants", "");
    us.restaurants ();
    us.enterarea("New st");
    //us.resultpage();

    exclwrdt.writeDataInBold("Doctors", "");
    us.Home_page();
    us.doctors();
    us.enterarea("New st");
    //us.resultpage();


    exclwrdt.writeDataInBold("Hotels", "");
    us.Home_page();
    us.Hotels();
    us.enterarea("New st");
    //us.resultpage();

    exclwrdt.writeDataInBold("Car dealers", "");
    us.Home_page();
    us.Car_Dealers();
    us.enterarea("New st");

    exclwrdt.writeDataInBold("Movies", "");
    us.Home_page();
    us.Movies();
    us.enterarea("New St");*/

    exclwrdt.writeDataInBold("Login", "");
    us.Home_page();
    us.Login();

    //exclwrdt.writeDataInBold("Freelisting", "");
    //us.Freelisting();

    //exclwrdt.writeDataInBold("Testimonials", "");
    //us.Home_page();
    //us.Testimonials(); 

    exclwrdt.writeDataInBold("Details_Page", "");
    us.Home_page();
    us.Details_page();
    us.Details_page_Tabs(); 

    //exclwrdt.writeDataInBold("Feedback", "");
    //us.Home_page();
    //us.Feedback();

    exclwrdt.writeDataInBold("Results Page", "");
    us.Home_page();
    us.resultpage0();
    }




    @Test (priority = 2)
    public void CAAutomation() throws InterruptedException, IOException  {
         WebDriver driver = null;
        exclwrdt.createFile();
        TestBase api = new TestBase();
        US_Home us = new US_Home(driver, exclwrdt); 

        //--------------------------------------------------------------------------------------

        exclwrdt.createWorkSheet("Web_Canada_Home", 0);

        us.Proxy_Server("https://ca.justdial.com/");
        exclwrdt.writeDataInBold("Proxy Server", "");

        //us.closeDriver();
        //exclwrdt.writeDataInBold("Proxy Server closed", "");

        us.jdpagelaunch("https://ca.justdial.com/");
        exclwrdt.writeDataInBold("Toronto", "");


        /*exclwrdt.writeDataInBold("Restaurants", "");
        us.restaurants ();
        us.enterarea("New st");
        //us.resultpage();

        exclwrdt.writeDataInBold("Doctors", "");
        us.Home_page();
        us.doctors();
        us.enterarea("New st");
        //us.resultpage();


        exclwrdt.writeDataInBold("Hotels", "");
        us.Home_page();
        us.Hotels();
        us.enterarea("New st");
        //us.resultpage();

        exclwrdt.writeDataInBold("Car dealers", "");
        us.Home_page();
        us.Car_Dealers();
        us.enterarea("New st");*/

        exclwrdt.writeDataInBold("Movies", "");
        us.Home_page();
        us.Movies();
        us.enterarea("New st");

    /*  exclwrdt.writeDataInBold("Login", "");
        us.Home_page();
        us.Login();

        exclwrdt.writeDataInBold("Freelisting", "");
        us.Freelisting();

        exclwrdt.writeDataInBold("Testimonials", "");
        us.Home_page();
        us.Testimonials();  

        //exclwrdt.writeDataInBold("Details_Page", "");
        //us.Home_page();
        //us.Details_page();
        //us.Details_page_Tabs(); 

        exclwrdt.writeDataInBold("Feedback", "");
        us.Home_page();
        us.Feedback();

        exclwrdt.writeDataInBold("Results Page", "");
        us.Home_page();
    us.resultpage0();*/
        }




//------------------------------------------------------------------------------------------------  
@AfterTest(alwaysRun=true)

public void executeatlast() throws IOException, MessagingException 
{
    exclwrdt.closeWrite();
    //email.main(null);
        // InternetAddress[] recepients = InternetAddress.parse("testingteam@justdial.com,bharatsharma@justdial.com");
        InternetAddress[] recepients = InternetAddress.parse("vaibhav.singh@justdial.com");
     email.sendMail("vaibhav.singh@justdial.com",recepients, ExcelReadWrite.FileName, exclwrdt.getTabs(),"International Automation Report");

}
}

注意:我正在研究selenium库的框架。

错误日志如下:

log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
    Save changes
1512381676397   DeferredSave.webext.sc.lz4  DEBUG   Save changes
[Child 3944, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 3944, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1512381679408   DeferredSave.addons.json    DEBUG   Write succeeded
1512381679419   DeferredSave.webext.sc.lz4  DEBUG   Save changes
1512381679420   DeferredSave.webext.sc.lz4  DEBUG   Save changes
1512381679712   DeferredSave.webext.sc.lz4  DEBUG   Starting write
1512381679722   DeferredSave.webext.sc.lz4  DEBUG   Write succeeded
1512381680194   addons.xpi  INFO    Mapping fxdriver@googlecode.com to C:\Users\vaibhavsi\AppData\Local\Temp\anonymous2209326214180969524webdriver-profile\extensions\fxdriver@googlecode.com
1512381680194   addons.xpi  DEBUG   Ignoring file entry whose name is not a valid add-on ID: C:\Users\vaibhavsi\AppData\Local\Temp\anonymous2209326214180969524webdriver-profile\extensions\webdriver-staging
1512381680195   addons.xpi  DEBUG   Existing add-on fxdriver@googlecode.com in app-profile
1512381680196   addons.xpi  INFO    Mapping activity-stream@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\activity-stream@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping aushelper@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping e10srollout@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping firefox@getpocket.com to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1512381680197   addons.xpi  INFO    Mapping followonsearch@mozilla.com to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\followonsearch@mozilla.com.xpi
1512381680197   addons.xpi  INFO    Mapping formautofill@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\formautofill@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping onboarding@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\onboarding@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping screenshots@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\screenshots@mozilla.org.xpi
1512381680198   addons.xpi  INFO    Mapping shield-recipe-client@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\shield-recipe-client@mozilla.org.xpi
1512381680198   addons.xpi  INFO    Mapping webcompat@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1512381680200   addons.xpi  DEBUG   Existing add-on activity-stream@mozilla.org in app-system-defaults
1512381680200   addons.xpi  DEBUG   Existing add-on aushelper@mozilla.org in app-system-defaults
1512381680202   addons.xpi  DEBUG   Existing add-on e10srollout@mozilla.org in app-system-defaults
1512381680203   addons.xpi  DEBUG   Existing add-on firefox@getpocket.com in app-system-defaults
1512381680203   addons.xpi  DEBUG   Existing add-on followonsearch@mozilla.com in app-system-defaults
1512381680204   addons.xpi  DEBUG   Existing add-on formautofill@mozilla.org in app-system-defaults
1512381680204   addons.xpi  DEBUG   Existing add-on onboarding@mozilla.org in app-system-defaults
1512381680205   addons.xpi  DEBUG   Existing add-on screenshots@mozilla.org in app-system-defaults
1512381680206   addons.xpi  DEBUG   Existing add-on shield-recipe-client@mozilla.org in app-system-defaults
1512381680207   addons.xpi  DEBUG   Existing add-on webcompat@mozilla.org in app-system-defaults
1512381680208   addons.xpi  INFO    Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
1512381680210   addons.xpi  DEBUG   Existing add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1512381680211   addons.xpi  DEBUG   getInstallState changed: false, state: {}

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:113)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at com.justdial.International.US_Home.<init>(US_Home.java:25)
    at com.justdial.International.IntlAutomation.USAutomation(IntlAutomation.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
    at org.testng.TestRunner.privateRun(TestRunner.java:771)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1032)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Dec 04, 2017 3:31:42 PM org.openqa.selenium.os.ProcessUtils killWinProcess
WARNING: Process refused to die after 10 seconds, and couldn't taskkill it
java.lang.NullPointerException: Unable to find executable for: taskkill
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:823)
    at org.openqa.selenium.os.UnixProcess.<init>(UnixProcess.java:62)
    at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:38)
    at org.openqa.selenium.os.WindowsUtils.killPID(WindowsUtils.java:178)
    at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:138)
    at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:247)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$200(UnixProcess.java:201)
    at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
    at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
    at org.openqa.selenium.firefox.FirefoxBinary.quit(FirefoxBinary.java:246)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.quit(NewProfileExtensionConnection.java:194)
    at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.quit(FirefoxDriver.java:364)
    at org.openqa.selenium.firefox.FirefoxDriver.stopClient(FirefoxDriver.java:310)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:122)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at com.justdial.International.US_Home.<init>(US_Home.java:25)
    at com.justdial.International.IntlAutomation.USAutomation(IntlAutomation.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
    at org.testng.TestRunner.privateRun(TestRunner.java:771)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1032)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

1 个答案:

答案 0 :(得分:1)

我可以在 pom.xml 中看到一些问题。你能按如下方式更新它们:

  • <强> poi-ooxml

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.9</version>
    </dependency>
    
  • <强> poi-ooxml-schemas

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml-schemas</artifactId>
        <version>3.9</version>
    </dependency>
    

更新:

这些错误无害且已记录,因为您已在此项目的某个模块中配置了Apache Log4j,但未在此模块中配置。因此你看到了这些:

log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

您的主要错误是:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

此错误的原因是 Selenium Client Firefox Web Browser 不匹配。在您尝试使用 Firefox v57.0 时,请尝试使用最新版本的 Selenium Client ,即 v3.8.1 GeckoDriver v0.19.1