Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am running some Selenium-Tests. When I start them directly from Eclipse everything works fine. But when I Start them through Maven there the following Exception occurs:

org.openqa.selenium.WebDriverException(Failed to connect to binary FirefoxBinary(C:winappFirefoxfirefox.exe) on port 7055; process output follows: 
null
Build info: version: '2.26.0', revision: '18040', time: '2012-11-02 09:44:45'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.6.0_35'
Driver info: driver.version: FirefoxDriver)

I am using Firefox 10.0.10 ESR. I have also tried it with Selenium 2.25.0.

Here is my latest version of the pom.xml:

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.26.0</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>2.26.0</version>
        <exclusions>
            <exclusion>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.4.1</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>org.jdom</groupId>
        <artifactId>jdom2</artifactId>
        <version>2.0.3</version>
    </dependency>
</dependencies>

If I can support you with more information, please let me know.

edit: updated pom.xml

edit2: What wonders me most, is that i can run the tests from eclipse without ans problems. they just occure, if i call "mvn install" for example

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
122 views
Welcome To Ask or Share your Answers For Others

1 Answer

When I encounter this error it's usually one of two things.

The Selenium version does not support the browser version Double check the Selenium/browser versions are the same when ran from Eclipse vs Maven. Double check Eclipse and Maven are configured to use the same Selenium version. This occurred for me when my browser auto updates so I turned that off in the browser.

The Selenium tests are running in headless mode Unlikely if your manually executing mvn on the same machine as Eclipse. This occurred for me when running Selenium through Maven on my Jenkins server. The Jenkins server was running in headless mode. Took me minute to figure out the headless stuff, think I set a DISPLAY env variable in Linux or something.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...