Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
245 views
by Contributing Tester (78 points)
retagged by
I am using geckodriver 0.18.0. Most of the time, when i run the script, its failed due to selenium webdriver exception.After that if i tried 2-3 times, it will be connected. This issue is coming from selenium or i have to make some correction. Please provide some solution.

FAILED CONFIGURATION: @BeforeTest TestSetup
org.openqa.selenium.WebDriverException: connection refused
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'KT-018', ip: '10.0.0.156', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_144'
Driver info: driver.version: FirefoxDriver
remote stacktrace: stack backtrace:
   0:   0x4e6bd4 - <no info>
   1:   0x43e83c - <no info>
   2:   0x4438d4 - <no info>

===============================================
    Default test
    Tests run: 1, Failures: 0, Skips: 1
    Configuration Failures: 1, Skips: 1
===============================================

===============================================
Default suite
Total tests run: 1, Failures: 0, Skips: 1
Configuration Failures: 1, Skips: 1
===============================================

1 Answer

0 like 0 dislike
by Master (1.2k points)
There are two primary reasons "Connection Refused" exception usually occurs.

1. When your geckodriver is not closed properly.

After you complete your execution, make sure that

driver.quit() is called.

2. When any plugin is blocking Firefox to close.

Make sure that geckodriver process in the "Task Manager" is not showing up.

If so, close all instances of GeckoDriver and Firefox browser.

Analyze that any plugin/extension is blocking Firefox from closing properly. If so, remove it. Especially your Antivirus and AdBlocker will be my suspects.

At last, I would also suggest you use the latest GeckoDriver and recent or second last version of your Firefox browser. And stop auto update of the Firefox browser.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...