Spring 无法连接到端口7055上的二进制FirefoxBinary(C:\Program Files(x86)\Mozilla Firefox\Firefox.exe)

Spring 无法连接到端口7055上的二进制FirefoxBinary(C:\Program Files(x86)\Mozilla Firefox\Firefox.exe),spring,jakarta-ee,maven,selenium,continuous-integration,Spring,Jakarta Ee,Maven,Selenium,Continuous Integration,我正在尝试将selenium测试作为maven build的一部分运行,以下是我的参考: 依赖关系: <dependency> <groupId>org.seleniumhq.selenium.client-drivers</groupId> <artifactId>selenium-java-client-driver</artifactId> <version>1

我正在尝试将selenium测试作为maven build的一部分运行,以下是我的参考:

  • 依赖关系

        <dependency>
            <groupId>org.seleniumhq.selenium.client-drivers</groupId>
            <artifactId>selenium-java-client-driver</artifactId>
            <version>1.0.2</version> 
            <scope>test</scope>
        </dependency>
    
        <dependency>
           <groupId>org.seleniumhq.webdriver</groupId>
           <artifactId>webdriver-firefox</artifactId>
           <version>0.9.7376</version>
        </dependency>
    
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-war-plugin</artifactId>
           <version>2.1.1</version>
        </plugin>
    
        <!-- Selenium plugin to start selenium server -->
    
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>selenium-maven-plugin</artifactId>
              <executions>
                    <execution>
                    <id>start</id>
                    <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start-server</goal>
                        </goals>
                    <configuration>
                        <background>true</background>
                        <logOutput>true</logOutput>
                    </configuration>
                </execution>
    
                <execution>
                <id>stop</id>
                <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop-server</goal>
                        </goals>
                </execution>
            </executions>
    </plugin>
    
        <!-- Cargo plugin to start servlet container when integration test runs -->
    
        <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
                <wait>false</wait> 
                <container>
                <containerId>tomcat7x</containerId>
                    <type>installed</type>
                    <home>${env.CATALINA_HOME}</home>
                </container>
            </configuration>
                <executions>
                    <execution>
                    <id>start-container</id>
                    <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                    <execution>
                    <id>stop-container</id>
                    <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
        </plugin> 
    
        <plugin>
    
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.8</version>
    
                <configuration>
                    <junitArtifactName>
                    org.junit:com.springsource.org.junit
                    </junitArtifactName>
                    <excludes>
    
                        <exclude>**/unit/*Test.java</exclude>
                    </excludes>
                </configuration>
    
    
                <executions>
                    <execution>
    
                    <id>integration-tests</id>
                    <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    <configuration>
                    <skip>false</skip>
                    <excludes>
                        <exclude>none</exclude>
                    </excludes>
    
                    <includes>
                       <include>**/integration/*Test.java</include>
                    </includes>
                    </configuration>
                    </execution>
            </executions>
    
            </plugin>
    

    更新:我正在使用firefox 9。

    使用以下依赖项后,错误消失:

            <dependency>
              <groupId>org.seleniumhq.selenium</groupId>
              <artifactId>selenium-firefox-driver</artifactId>
              <version>2.16.1</version>         
            </dependency>
    
    
    org.seleniumhq.selenium
    selenium firefox驱动程序
    2.16.1         
    
    并删除此项:

    <dependency>
       <groupId>org.seleniumhq.webdriver</groupId>
       <artifactId>webdriver-firefox</artifactId>
       <version>0.9.7376</version>
    </dependency>
    
    
    org.seleniumhq.webdriver
    网络驱动程序firefox
    0.9.7376
    
    使用以下依赖项后,错误消失:

            <dependency>
              <groupId>org.seleniumhq.selenium</groupId>
              <artifactId>selenium-firefox-driver</artifactId>
              <version>2.16.1</version>         
            </dependency>
    
    
    org.seleniumhq.selenium
    selenium firefox驱动程序
    2.16.1         
    
    并删除此项:

    <dependency>
       <groupId>org.seleniumhq.webdriver</groupId>
       <artifactId>webdriver-firefox</artifactId>
       <version>0.9.7376</version>
    </dependency>
    
    
    org.seleniumhq.webdriver
    网络驱动程序firefox
    0.9.7376
    
    您至少需要Selenium 2.15版才能支持Firefox 9(参考)

    您至少需要Selenium 2.15版来支持Firefox 9(参考)

    我也有同样的问题。 如果您使用的是v36.01版本,但问题仍然存在,则该错误已在v36.01中修复。请重新安装该版本。

    我遇到了相同的问题。
    如果您使用的是v36.01版本,并且问题仍然存在,则该错误已在v36.01中修复。请重新安装该版本

    在将FF 12与WebDriver一起使用时,我还遇到以下错误:org.openqa.selenium.WebDriverException:无法连接到端口7055上的二进制FirefoxBinary(C:\Program Files\Mozilla Firefox\Firefox.exe);进程输出如下:null我停止了FF的自动更新,它运行良好。在将FF 12与WebDriver一起使用时,我还遇到以下错误:org.openqa.selenium.WebDriverException:无法连接到端口7055上的二进制FirefoxBinary(C:\Program Files\Mozilla Firefox\Firefox.exe);流程输出如下:null我停止了FF的自动更新,它工作得很好。