0 votes
1 view
in Devops and Agile by (18.3k points)

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:\winapp\Firefox\firefox.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 any problems. they just occur, if I call "mvn install" for example

1 Answer

0 votes
by (48.8k points)

When I encounter this error, it is usually one of two things.

The Selenium version does not support the browser version. Double-checking the versions of the Selenium/browser is the same when running from Eclipse vs Maven. Double-check Eclipse and Maven are configured to use the same version of Selenium. This happened to me when my browser was automatically updated, so I turned it off in the browser.

Selenium tests run in silent mode. It is unlikely if you manually executed mvn on the same machine as Eclipse. This happened to me when I started selenium through Maven on my Jenkins server. Jenkins server worked in headless mode. It took a little bit to deal with headless things, I think I set the env variable in env Linux or something like that.

Attempt to add this to your pom

<dependency> <groupId>org.seleniumhq.webdriver</groupId> <artifactId>selenium-firefox-driver</artifactId> <version>2.XX.X</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId> <version>2.XX.X</version> </dependency>

Hope this helps!

...