0

When I am running my webdriver project then sometime it throws the exception for "Not Connected" and sometime it works fine.

Also, when it connect and start the execution then at mid of execution its not able to find the object and execution will stay there..

As I have seen some of the reference site and found that their is some configuration problem, so I've tried below points:

  1. I have executed the program by creating the path ff-binary, that time my Firefox version is 29 and Selenium-2.49.0
  2. I have tried ff-binary with Selenium-2.52.0 too with Firefox version is 29 but still getting the same problem.
  3. I have tried with my updated default Firefox version 44.0b1 and selenium-2.52.0 and 2.53.0 but still getting the same problem.

Can any one please let me know the solution to make this problem fix.

Console Output:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
,"maxVersion":"47.0"}],"targetPlatforms":[{"os":"Darwin","abi":null},{"os":"SunOS","abi":null},{"os":"FreeBSD","abi":null},{"os":"OpenBSD","abi":null},{"os":"WINNT","abi":null},{"os":"Linux","abi":null}],"multiprocessCompatible":false,"signedState":0}
1459838940361   addons.xpi  DEBUG   getModTime: Recursive scan of fxdriver@googlecode.com
1459838940392   addons.xpi  DEBUG   Updating XPIState for {"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","syncGUID":"VkfhbWyu_8Qh","location":"app-global","version":"44.0","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","installDate":1457930979545,"updateDate":1457930979545,"applyBackgroundUpdates":1,"skinnable":true,"size":24166,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"44.0","maxVersion":"44.0"}],"targetPlatforms":[]}
1459838940392   addons.xpi  DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1459838940396   DeferredSave.extensions.json    DEBUG   Save changes
1459838940396   addons.xpi  DEBUG   Updating database with changes to installed add-ons
1459838940396   addons.xpi-utils    DEBUG   Updating add-on states
1459838940399   addons.xpi-utils    DEBUG   Writing add-ons list
1459838940424   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1459838940425   addons.manager  DEBUG   Provider finished startup: XPIProvider
1459838940425   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1459838940425   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1459838940425   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1459838940426   addons.manager  DEBUG   Starting provider: GMPProvider
1459838940438   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1459838940439   addons.manager  DEBUG   Provider finished startup: GMPProvider
1459838940439   addons.manager  DEBUG   Starting provider: PluginProvider
1459838940439   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1459838940440   addons.manager  DEBUG   Provider finished startup: PluginProvider
1459838940440   addons.manager  DEBUG   Completed startup sequence
1459838941252   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1459838941252   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1459838941253   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1459838941515   DeferredSave.extensions.json    DEBUG   Starting write
1459838942317   addons.repository   DEBUG   No addons.json found.
1459838942317   DeferredSave.addons.json    DEBUG   Save changes
1459838942322   DeferredSave.addons.json    DEBUG   Starting timer
1459838942348   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1459838942348   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1459838942349   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1459838942357   DeferredSave.extensions.json    DEBUG   Write succeeded
1459838942358   addons.xpi-utils    DEBUG   XPI Database saved, setting schema version preference to 17
JavaScript error: chrome://fxdriver/content/server.js, line 61: uncaught exception: [object Object]
JavaScript error: chrome://fxdriver/content/server.js, line 61: NS_ERROR_XPC_CI_RETURNED_FAILURE: Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]
1459838942625   DeferredSave.addons.json    DEBUG   Starting write
1459838943133   DeferredSave.addons.json    DEBUG   Write succeeded

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:112)
    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:218)
    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.chayan.af.MainClass.<init>(MainClass.java:64)
    at com.chayan.af.MainClass.main(MainClass.java:70)
Exception in thread "main" org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055; process output follows: 
,"maxVersion":"47.0"}],"targetPlatforms":[{"os":"Darwin","abi":null},{"os":"SunOS","abi":null},{"os":"FreeBSD","abi":null},{"os":"OpenBSD","abi":null},{"os":"WINNT","abi":null},{"os":"Linux","abi":null}],"multiprocessCompatible":false,"signedState":0}
1459838940361   addons.xpi  DEBUG   getModTime: Recursive scan of fxdriver@googlecode.com
1459838940392   addons.xpi  DEBUG   Updating XPIState for {"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","syncGUID":"VkfhbWyu_8Qh","location":"app-global","version":"44.0","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","installDate":1457930979545,"updateDate":1457930979545,"applyBackgroundUpdates":1,"skinnable":true,"size":24166,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"44.0","maxVersion":"44.0"}],"targetPlatforms":[]}
1459838940392   addons.xpi  DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1459838940396   DeferredSave.extensions.json    DEBUG   Save changes
1459838940396   addons.xpi  DEBUG   Updating database with changes to installed add-ons
1459838940396   addons.xpi-utils    DEBUG   Updating add-on states
1459838940399   addons.xpi-utils    DEBUG   Writing add-ons list
1459838940424   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1459838940425   addons.manager  DEBUG   Provider finished startup: XPIProvider
1459838940425   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1459838940425   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1459838940425   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1459838940426   addons.manager  DEBUG   Starting provider: GMPProvider
1459838940438   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1459838940439   addons.manager  DEBUG   Provider finished startup: GMPProvider
1459838940439   addons.manager  DEBUG   Starting provider: PluginProvider
1459838940439   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1459838940440   addons.manager  DEBUG   Provider finished startup: PluginProvider
1459838940440   addons.manager  DEBUG   Completed startup sequence
1459838941252   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1459838941252   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1459838941253   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1459838941515   DeferredSave.extensions.json    DEBUG   Starting write
1459838942317   addons.repository   DEBUG   No addons.json found.
1459838942317   DeferredSave.addons.json    DEBUG   Save changes
1459838942322   DeferredSave.addons.json    DEBUG   Starting timer
1459838942348   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1459838942348   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1459838942349   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1459838942357   DeferredSave.extensions.json    DEBUG   Write succeeded
1459838942358   addons.xpi-utils    DEBUG   XPI Database saved, setting schema version preference to 17
JavaScript error: chrome://fxdriver/content/server.js, line 61: uncaught exception: [object Object]
JavaScript error: chrome://fxdriver/content/server.js, line 61: NS_ERROR_XPC_CI_RETURNED_FAILURE: Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]
1459838942625   DeferredSave.addons.json    DEBUG   Starting write
1459838943133   DeferredSave.addons.json    DEBUG   Write succeeded

Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: 'sipl157', ip: '10.10.10.157', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_60'
Driver info: driver.version: FirefoxDriver
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:124)
    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:218)
    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.chayan.af.MainClass.<init>(MainClass.java:64)
    at com.chayan.af.MainClass.main(MainClass.java:70)
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
,"maxVersion":"47.0"}],"targetPlatforms":[{"os":"Darwin","abi":null},{"os":"SunOS","abi":null},{"os":"FreeBSD","abi":null},{"os":"OpenBSD","abi":null},{"os":"WINNT","abi":null},{"os":"Linux","abi":null}],"multiprocessCompatible":false,"signedState":0}
1459838940361   addons.xpi  DEBUG   getModTime: Recursive scan of fxdriver@googlecode.com
1459838940392   addons.xpi  DEBUG   Updating XPIState for {"id":"{972ce4c6-7e08-4474-a285-3208198ce6fd}","syncGUID":"VkfhbWyu_8Qh","location":"app-global","version":"44.0","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}","installDate":1457930979545,"updateDate":1457930979545,"applyBackgroundUpdates":1,"skinnable":true,"size":24166,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"44.0","maxVersion":"44.0"}],"targetPlatforms":[]}
1459838940392   addons.xpi  DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1459838940396   DeferredSave.extensions.json    DEBUG   Save changes
1459838940396   addons.xpi  DEBUG   Updating database with changes to installed add-ons
1459838940396   addons.xpi-utils    DEBUG   Updating add-on states
1459838940399   addons.xpi-utils    DEBUG   Writing add-ons list
1459838940424   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1459838940425   addons.manager  DEBUG   Provider finished startup: XPIProvider
1459838940425   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1459838940425   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1459838940425   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1459838940426   addons.manager  DEBUG   Starting provider: GMPProvider
1459838940438   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1459838940439   addons.manager  DEBUG   Provider finished startup: GMPProvider
1459838940439   addons.manager  DEBUG   Starting provider: PluginProvider
1459838940439   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1459838940440   addons.manager  DEBUG   Provider finished startup: PluginProvider
1459838940440   addons.manager  DEBUG   Completed startup sequence
1459838941252   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1459838941252   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1459838941253   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1459838941515   DeferredSave.extensions.json    DEBUG   Starting write
1459838942317   addons.repository   DEBUG   No addons.json found.
1459838942317   DeferredSave.addons.json    DEBUG   Save changes
1459838942322   DeferredSave.addons.json    DEBUG   Starting timer
1459838942348   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1459838942348   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1459838942349   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1459838942357   DeferredSave.extensions.json    DEBUG   Write succeeded
1459838942358   addons.xpi-utils    DEBUG   XPI Database saved, setting schema version preference to 17
JavaScript error: chrome://fxdriver/content/server.js, line 61: uncaught exception: [object Object]
JavaScript error: chrome://fxdriver/content/server.js, line 61: NS_ERROR_XPC_CI_RETURNED_FAILURE: Component returned failure code: 0x80570015 (NS_ERROR_XPC_CI_RETURNED_FAILURE) [nsIJSCID.createInstance]
1459838942625   DeferredSave.addons.json    DEBUG   Starting write
1459838943133   DeferredSave.addons.json    DEBUG   Write succeeded

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:112)
    ... 8 more

Code:

public class MainClass {
    /*private static final String BROWSER_PATH = "D:\\abc\\setup\\FFinstalled\\firefox.exe";*/
    private static final String BROWSER_PATH = "C:\\Program Files (x86)\\Mozilla\\firefox.exe";
    /*private static final String TEST_SUITE_PATH = "D:\\abc\\workspace for selenium\\AutomationFramework(16 june)\\AutomationFramework\\configuration\\GmailTestSuite.xls";
    private static final String TEST_RESULT = "D:\\abc\\workspace for selenium\\AutomationFramework(16 june)\\AutomationFramework\\configuration\\TestResult.xls";
    private static final String OBJECT_REPOSITORY_PATH = "D:\\abc\\workspace for selenium\\AutomationFramework(16 june)\\AutomationFramework\\configuration\\objectrepository.xls";*/

    private static final String TEST_SUITE_PATH = "D:\\abc\\workspace for selenium\\AutomationFramework(16 june)\\AutomationFramework\\StackTestSuite.xls";
    private static final String TEST_RESULT = "D:\\abc\\workspace for selenium\\AutomationFramework(16 june)\\AutomationFramework\\TestResult - Copy.xls";
    private static final String OBJECT_REPOSITORY_PATH = "D:\\abc\\workspace for selenium\\AutomationFramework(16 june)\\AutomationFramework\\objectrepository.xls";

    private static final String ADDRESS_TO_TEST = "http://stackoverflow.com/";

    // other constants

    static WebDriver driver=null;
    private Properties properties;
    private String screenshotName;

    WebDriverWait wait;

    /* private WebElement we; */

    public MainClass() {
        File file = new File(BROWSER_PATH);
        FirefoxBinary fb = new FirefoxBinary(file);
        FirefoxProfile firefoxProfile = new FirefoxProfile();
        driver = new FirefoxDriver(fb, firefoxProfile);
        driver.manage().window().maximize();
        //driver= new FirefoxDriver();
        driver.get(ADDRESS_TO_TEST);

    }
ChayanC
  • 201
  • 7
  • 29
  • i think selenium is not able to find the firefox exe so please uninstall firefox and please install its latest version also please use latest selenium as well this will work – Rajnish Kumar Apr 05 '16 at 07:13
  • @rajNishKuMar I have installed the latest Firefox version and client driver but still I am getting the exception "Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN8_1". – ChayanC Apr 05 '16 at 08:49
  • ok as per your comment org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH it's clear that selenium is not able to find firefox path then please specify path if not sure how then plz follow link provided by subham jain in below answer – Rajnish Kumar Apr 05 '16 at 09:29
  • @rajNishKuMar Please check the code which I am using.. and still getting the same issue. – ChayanC Apr 05 '16 at 09:52
  • Looking at the logs provided by you it seems every time you run selenium Firefox is being updated and also this issue has been reported with FF version greater then 35 please un-install FF completely and install FF v.33 it will work . – Rajnish Kumar Apr 05 '16 at 09:59
  • also please look at the possible solution for your question https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/7954 – Rajnish Kumar Apr 05 '16 at 10:17
  • did you tried by creating profile manually and then calling that saved profile..? i hope it works – murali selenium Apr 07 '16 at 16:03
  • @muraliseleniumtrainer I have tried by creating profile manually too.. – ChayanC Apr 11 '16 at 06:07

0 Answers0