Failed to connect to binary FirefoxBinary with Selenium in Maven

前端 未结 11 2618
终归单人心
终归单人心 2020-12-05 02:32

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:

相关标签:
11条回答
  • 2020-12-05 02:50

    Cannot find the firefoxbinary path. Please set the firefox path in advance of using firefox driver.

    System.setProperty("webdriver.firefox.bin", "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
    
    0 讨论(0)
  • 2020-12-05 02:51

    If you've updated both Firefox and Selenium to the latest versions in trying to fix this issue, and you are still facing the problem, you may have updated Firefox using "Restart to update".

    Shutdown Firefox and ensure that the Firefox executable is no longer running. Then try your test. It should work now.

    I'm guessing this is related to when exactly the Firefox binary is updated when you use "Restart to Update"

    0 讨论(0)
  • 2020-12-05 02:52

    I had this issue with Firefox 36, also people were facing the same in 35 and 44.

    For conclusion, upgrade your Firefox to 37 or downgrade it to anything less than 33.

    0 讨论(0)
  • 2020-12-05 03:02

    The same problem also occures when there is no left space on disk where your Firefox cache folder located. Just free the space and launch your scripts!

    0 讨论(0)
  • 2020-12-05 03:03
    my recommendation is 
    
        ===> switch to firefox version 50.0 [latest One] , 
    
        ===> download the gecko driver from [.](https://github.com/mozilla/geckodriver/releases)  and 
    
        ===> Selenium version 3.0.1
         <dependency>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-java</artifactId>
                    <version>3.0.1</version>
         </dependency>
    
        ==> On your Code 
    private WebDriver driver;
    System.setProperty("webdriver.gecko.driver", "PATH to GECKO DRIVER");
            driver = new FirefoxDriver();
    
        and yes you see the below output in your console :
    
    
        Dec 17, 2016 6:40:45 PM org.openqa.selenium.remote.ProtocolHandshake createSession
        INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
        14819XXXXXXX5   mozprofile::profile INFO    Using profile path C:\Users\User\AppData\Local\XXXXX\rust_XXXprofile.OXXXXXXXXXXX7S
        148XXXXXXXXX0   geckodriver::marionette INFO    Starting browser C:\Program Files\Mozilla Firefox\firefox.exe
        148XXXXXXXXX1   geckodriver::marionette INFO    Connecting to Marionette on localhost:XXXXXXX
        148198XXXX077   Marionette  INFO    Listening on port 53532
        Dec 17, 2016 6:40:55 PM org.openqa.selenium.remote.ProtocolHandshake createSession
        INFO: Detected dialect: W3C
        [Child 4104] ###!!! ABORT: Aborting on channel error.: file c:/builds/moz2_slave/m-rel-w32-00000000000000000000/build/src/ipc/glue/MessageChannel.cpp, line XXXX
        Dec 17, 2016 6:41:13 PM org.openqa.selenium.os.UnixProcess destroy
    
    0 讨论(0)
  • 2020-12-05 03:04

    Trying Adding this to your pom

    UPDATED:

    <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> 
    
    0 讨论(0)
提交回复
热议问题