4

I'm using Selenium 3.0 and I want to know what are the new updates in Selenium 3.0 over Selenium 2.0?

I'm trying to launch my firefox driver using remotewebdriver and every time it throws an exception:

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.

I used Geckodriver to launch firefox driver:

System.setProperty("webdriver.gecko.driver","path of geckodriver.exe");
WebDriver driver = new FirefoxDriver();

How to resolve above issue? May I know the new updates over Selenium 3.0 & 2.0 for my future reference?

2
  • Can you please add your firefox version to your question, Exception is thrown because of browser incompatibility with seleinum webdriver.
    – the_coder
    Commented Mar 9, 2017 at 13:10
  • You are asking two questions here, I suggest re-framing this question to ask one. You can google to find the updates / differences between Selenium 2 & 3. Commented Mar 10, 2017 at 6:05

1 Answer 1

3

Coming to your first question-
How to resolve exception while launching firefox in remotewebdriver:

First thing what I observed that- You have to change your code in Setup; as you are using remotewebdriver on remote machines.

To run tests on remote machines, WebDriver has to use the instance of the RemoteWebDriver and DesiredCapabilities in order to specify browser name, version and platform to execute tests.

Generally; to run tests on our local machine, we will just specify as WebDriver driver = new FirefoxDriver(); to run on Firefox browser.

To execute tests on remote machine, we need to use remotewebdriver, Check below is the code to execute your tests on remote machine with Firefox gecko driver:

System.setProperty("webdriver.gecko.driver", driverPath+"geckodriver.exe");
DesiredCapabilities capabilities=DesiredCapabilities.firefox();
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);

I have verified above code with selenium-server-standalone-3.0.0-beta2 and Firefox 48 version.

The most common issue people are facing with latest versions of Firefox is

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms.

Users who are facing the above problem, Please use Marionette (geckodriver).

Please let me know if you have any issues.


As you asked 2nd question- Updates in Selenium 3.0 over 2.0:

The important changes in Selenium 3.0 are:

  • The first one is launching firefox using the Geckodriver. When using Selenium 3 , you have to download geckodriver which its not required in 2.0
  • Selenium 3.0 will supports for Firefox Version after 47 only.
  • Minimum java version is now 8+
  • The original RC APIs are only available via the leg-rc package.
  • To run exported IDE tests, ensure that the leg-rc package is on the classpath.
  • Support for Firefox is via Mozilla's geckodriver.
  • Support for Edge is provided by MS:
  • Official support for IE requires version 9 or above
  • New html-table runner backed by WebDriver.
  • Unused command line arguments are now no longer parsed.
1
  • Ohh.. Nice one; I used Marionette (geckodriver) and added above code, It works like a charm. Thanks, dear...!
    – Sophia
    Commented Mar 14, 2017 at 4:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.