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:
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.